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

Function benchmarkRedisClient

bench_test.go:19–31  ·  view source on GitHub ↗
(ctx context.Context, poolSize int)

Source from the content-addressed store, hash-verified

17)
18
19func benchmarkRedisClient(ctx context.Context, poolSize int) *redis.Client {
20 client := redis.NewClient(&redis.Options{
21 Addr: ":6379",
22 DialTimeout: time.Second,
23 ReadTimeout: time.Second,
24 WriteTimeout: time.Second,
25 PoolSize: poolSize,
26 })
27 if err := client.FlushDB(ctx).Err(); err != nil {
28 panic(err)
29 }
30 return client
31}
32
33func BenchmarkRedisPing(b *testing.B) {
34 ctx := context.Background()

Callers 15

BenchmarkRedisPingFunction · 0.85
BenchmarkSetGoroutinesFunction · 0.85
BenchmarkRedisGetNilFunction · 0.85
BenchmarkRedisSetStringFunction · 0.85
benchmarkRedisGetFunction · 0.85
benchmarkRedisSetFunction · 0.85
BenchmarkRedisMGetFunction · 0.85

Calls 2

ErrMethod · 0.65
FlushDBMethod · 0.65

Tested by

no test coverage detected