(b *testing.B)
| 31 | } |
| 32 | |
| 33 | func BenchmarkRedisPing(b *testing.B) { |
| 34 | ctx := context.Background() |
| 35 | rdb := benchmarkRedisClient(ctx, 10) |
| 36 | defer rdb.Close() |
| 37 | |
| 38 | b.ResetTimer() |
| 39 | |
| 40 | b.RunParallel(func(pb *testing.PB) { |
| 41 | for pb.Next() { |
| 42 | if err := rdb.Ping(ctx).Err(); err != nil { |
| 43 | b.Fatal(err) |
| 44 | } |
| 45 | } |
| 46 | }) |
| 47 | } |
| 48 | |
| 49 | func BenchmarkSetGoroutines(b *testing.B) { |
| 50 | ctx := context.Background() |
nothing calls this directly
no test coverage detected