MCPcopy Create free account
hub / github.com/evilsocket/sum / BenchmarkOraclesFind

Function BenchmarkOraclesFind

storage/oracles_benchmark_test.go:7–22  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

5)
6
7func BenchmarkOraclesFind(b *testing.B) {
8 setupOracles(b, true, false, false)
9 defer teardownOracles(b)
10
11 oracles, err := LoadOracles(testFolder)
12 if err != nil {
13 b.Fatal(err)
14 }
15
16 for i := 0; i < b.N; i++ {
17 id := uint64(i%testOracles) + 1
18 if o := oracles.Find(id); o == nil {
19 b.Fatalf("oracle with id %d not found", id)
20 }
21 }
22}
23
24func BenchmarkOraclesUpdate(b *testing.B) {
25 setupOracles(b, true, false, false)

Callers

nothing calls this directly

Calls 4

setupOraclesFunction · 0.85
teardownOraclesFunction · 0.85
LoadOraclesFunction · 0.85
FindMethod · 0.45

Tested by

no test coverage detected