Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // An example benchmark to benchmark a query based on different inputs
- func Benchmark_GetProcessingCountForRegions(b *testing.B) {
- benchmarks := []struct {
- region string
- }{
- {"EU"},
- {"US"},
- }
- for _, bm := range benchmarks {
- b.Run(bm.region, func(bbb *testing.B) {
- for i := 0; i < bbb.N; i++ {
- taskDb.GetProcessingCountForRegion(bm.region)
- }
- })
- }
- }
- func GetProcessingCountForRegion(testingB *testing.B, region string) {
- for i := 0; i < testingB.N; i++ {
- taskDb.GetProcessingCountForRegion(region)
- }
- }
- for _, bm := range benchmarks {
- b.Run(bm.region, GetProcessingCountForRegion(*b, bm.region))
- }
Add Comment
Please, Sign In to add comment