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

Function BenchmarkServiceUpdateOracle

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

Source from the content-addressed store, hash-verified

25}
26
27func BenchmarkServiceUpdateOracle(b *testing.B) {
28 setup(b, true, true)
29 defer teardown(b)
30
31 svc, err := New(testFolder, "", "")
32 if err != nil {
33 b.Fatal(err)
34 }
35
36 ctx := context.TODO()
37 for i := 0; i < b.N; i++ {
38 updatedOracle.Id = uint64(i%testOracles) + 1
39 if _, err := svc.UpdateOracle(ctx, &updatedOracle); err != nil {
40 b.Fatal(err)
41 }
42 }
43}
44
45func BenchmarkServiceReadOracle(b *testing.B) {
46 setup(b, true, true)

Callers

nothing calls this directly

Calls 4

setupFunction · 0.85
teardownFunction · 0.85
NewFunction · 0.85
UpdateOracleMethod · 0.65

Tested by

no test coverage detected