mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 17:15:56 +00:00
```bash for file in `cat diffys`; do printf '%s\n%s\n' "// Copyright 2021 Molecula Corp. All rights reserved." "$(cat $file)" >$file; done ```
36 lines
651 B
Go
36 lines
651 B
Go
// Copyright 2021 Molecula Corp. All rights reserved.
|
|
//
|
|
//go:build generationdebug
|
|
// +build generationdebug
|
|
|
|
package pilosa
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
"runtime"
|
|
|
|
"github.com/molecula/featurebase/v2/testhook"
|
|
)
|
|
|
|
func examineResults() error {
|
|
runtime.GC()
|
|
stats, results := reportGenerations()
|
|
if len(stats) > 0 {
|
|
fmt.Printf("generation stats: %s\n", stats)
|
|
}
|
|
if len(results) == 0 {
|
|
return nil
|
|
}
|
|
if len(results) > 0 {
|
|
fmt.Printf("generations:\n")
|
|
for _, res := range results {
|
|
fmt.Printf(" %s\n", res)
|
|
}
|
|
}
|
|
return errors.New("outstanding generations detected")
|
|
}
|
|
|
|
func init() {
|
|
testhook.RegisterPostTestHook(examineResults)
|
|
}
|