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

Function BenchmarkRedisGetNil

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

Source from the content-addressed store, hash-verified

71}
72
73func BenchmarkRedisGetNil(b *testing.B) {
74 ctx := context.Background()
75 client := benchmarkRedisClient(ctx, 10)
76 defer client.Close()
77
78 b.ResetTimer()
79
80 b.RunParallel(func(pb *testing.PB) {
81 for pb.Next() {
82 if err := client.Get(ctx, "key").Err(); err != redis.Nil {
83 b.Fatal(err)
84 }
85 }
86 })
87}
88
89type setStringBenchmark struct {
90 poolSize int

Callers

nothing calls this directly

Calls 5

benchmarkRedisClientFunction · 0.85
CloseMethod · 0.65
NextMethod · 0.65
ErrMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected