(b *testing.B)
| 167 | } |
| 168 | |
| 169 | func BenchmarkChainParallelWrite(b *testing.B) { |
| 170 | var r = setupBenchmarkChainRequest(b) |
| 171 | var c = setupBenchmarkChain(b) |
| 172 | b.RunParallel(func(pb *testing.PB) { |
| 173 | var ( |
| 174 | err error |
| 175 | counter int32 |
| 176 | ) |
| 177 | for pb.Next() { |
| 178 | if _, err = c.Query(r[newKeyPermKeygen.next()]); err != nil { |
| 179 | b.Fatalf("Failed to execute: %v", err) |
| 180 | } |
| 181 | if atomic.AddInt32(&counter, 1)%benchmarkQueriesPerBlock == 0 { |
| 182 | if err = c.state.commit(); err != nil { |
| 183 | b.Fatalf("failed to commit block: %v", err) |
| 184 | } |
| 185 | } |
| 186 | } |
| 187 | }) |
| 188 | teardownBenchmarkChain(b, c) |
| 189 | } |
| 190 | |
| 191 | func BenchmarkChainParallelMixRW(b *testing.B) { |
| 192 | var r = setupBenchmarkChainRequest(b) |
nothing calls this directly
no test coverage detected