MCPcopy Create free account
hub / github.com/couchbase/moss / BenchmarkCollectionGets

Function BenchmarkCollectionGets

benchmark_get_test.go:43–59  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

41}
42
43func BenchmarkCollectionGets(b *testing.B) {
44 tmpDir, _ := ioutil.TempDir("", "benchStore")
45 defer os.RemoveAll(tmpDir)
46
47 store, coll, keys := createStoreAndWriteNItems(tmpDir, 10000, 100)
48 defer store.Close()
49 defer coll.Close()
50
51 b.ResetTimer()
52
53 for i := 0; i < b.N; i++ {
54 _, err := coll.Get(keys[i%len(keys)], ReadOptions{})
55 if err != nil {
56 panic("Collection-Get() failed!")
57 }
58 }
59}
60
61// ---------------------------------------------------------------
62

Callers

nothing calls this directly

Calls 3

CloseMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…