MCPcopy
hub / github.com/redis/go-redis / BenchmarkRedisPing

Function BenchmarkRedisPing

bench_test.go:33–47  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

31}
32
33func 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
49func BenchmarkSetGoroutines(b *testing.B) {
50 ctx := context.Background()

Callers

nothing calls this directly

Calls 5

benchmarkRedisClientFunction · 0.85
CloseMethod · 0.65
NextMethod · 0.65
ErrMethod · 0.65
PingMethod · 0.65

Tested by

no test coverage detected