(ctx context.Context, poolSize int)
| 17 | ) |
| 18 | |
| 19 | func 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 | |
| 33 | func BenchmarkRedisPing(b *testing.B) { |
| 34 | ctx := context.Background() |
no test coverage detected