diff --git a/db.go b/db.go index ef95a54bf..3abff2a9c 100644 --- a/db.go +++ b/db.go @@ -391,6 +391,10 @@ func (db *DB) createFrame(name string, opt FrameOptions) (*Frame, error) { if opt.RowLabel != "" { f.rowLabel = opt.RowLabel } + if opt.CacheSize != 0 { + f.rankedCacheSize = opt.CacheSize + } + f.inverseEnabled = opt.InverseEnabled if err := f.saveMeta(); err != nil { f.Close() diff --git a/fragment.go b/fragment.go index 0b1734593..4f6362193 100644 --- a/fragment.go +++ b/fragment.go @@ -222,25 +222,6 @@ func (f *Fragment) openStorage() error { } -// // It will be the one and only identifier after a package specifier. -// var testNameRegexp = regexp.MustCompile(`\.(Test[\p{L}_\p{N}]*)$`) - -// // Returns the name of the test function from the call stack. See -// // http://stackoverflow.com/q/35535635/149482 for another method. -// func GetTestName() string { -// pc := make([]uintptr, 32) -// n := runtime.Callers(0, pc) -// for i := 0; i < n; i++ { -// name := runtime.FuncForPC(pc[i]).Name() -// ms := testNameRegexp.FindStringSubmatch(name) -// if ms == nil { -// continue -// } -// return ms[1] -// } -// panic("test name could not be recovered") -// } - // openCache initializes the cache from bitmap ids persisted to disk. func (f *Fragment) openCache() error { // Determine cache type from frame name. @@ -256,9 +237,6 @@ func (f *Fragment) openCache() error { return ErrInvalidCacheType } - // fmt.Println(GetTestName()) - // fmt.Printf("CACHE SIZE: %d\n", f.cacheSize) - // Read cache data from disk. path := f.CachePath() buf, err := ioutil.ReadFile(path)