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

Function BenchmarkServiceDeleteOracle

service/oracles_benchmark_test.go:80–102  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

78}
79
80func BenchmarkServiceDeleteOracle(b *testing.B) {
81 var svc *Service
82 var err error
83
84 defer teardown(b)
85 ctx := context.TODO()
86 for i := 0; i < b.N; i++ {
87 // this is not entirely ok as once every 5 times
88 // we neeed to recreate and reload oracles, which
89 // increases the operations being benchmarked
90 id := uint64(i%testOracles) + 1
91 if id == 1 {
92 setup(b, true, true)
93 if svc, err = New(testFolder, "", ""); err != nil {
94 b.Fatal(err)
95 }
96 }
97
98 if _, err := svc.DeleteOracle(ctx, &pb.ById{Id: id}); err != nil {
99 b.Fatal(err)
100 }
101 }
102}

Callers

nothing calls this directly

Calls 4

DeleteOracleMethod · 0.95
teardownFunction · 0.85
setupFunction · 0.85
NewFunction · 0.85

Tested by

no test coverage detected