MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / BenchmarkChainParallelMixRW

Function BenchmarkChainParallelMixRW

xenomint/chain_test.go:191–211  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

189}
190
191func BenchmarkChainParallelMixRW(b *testing.B) {
192 var r = setupBenchmarkChainRequest(b)
193 var c = setupBenchmarkChain(b)
194 b.RunParallel(func(pb *testing.PB) {
195 var (
196 err error
197 counter int32
198 )
199 for pb.Next() {
200 if _, err = c.Query(r[allKeyPermKeygen.next()]); err != nil {
201 b.Fatalf("Failed to execute: %v", err)
202 }
203 if atomic.AddInt32(&counter, 1)%benchmarkQueriesPerBlock == 0 {
204 if err = c.state.commit(); err != nil {
205 b.Fatalf("failed to commit block: %v", err)
206 }
207 }
208 }
209 })
210 teardownBenchmarkChain(b, c)
211}
212
213func TestChain(t *testing.T) {
214 Convey("test xenomint chain", t, func() {

Callers

nothing calls this directly

Calls 8

setupBenchmarkChainFunction · 0.85
teardownBenchmarkChainFunction · 0.85
FatalfMethod · 0.80
QueryMethod · 0.65
nextMethod · 0.65
NextMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected