(b *testing.B)
| 531 | } |
| 532 | |
| 533 | func BenchmarkClusterDoInt(b *testing.B) { |
| 534 | if testing.Short() { |
| 535 | b.Skip("skipping in short mode") |
| 536 | } |
| 537 | |
| 538 | ctx := context.Background() |
| 539 | if clusterBench == nil { |
| 540 | clusterBench = newClusterScenario() |
| 541 | if err := configureClusterTopology(ctx, clusterBench); err != nil { |
| 542 | b.Fatal(err) |
| 543 | } |
| 544 | } |
| 545 | |
| 546 | client := clusterBench.newClusterClient(ctx, redisClusterOptions()) |
| 547 | defer client.Close() |
| 548 | |
| 549 | b.Run("cluster do set int", func(b *testing.B) { |
| 550 | b.ResetTimer() |
| 551 | b.RunParallel(func(pb *testing.PB) { |
| 552 | for pb.Next() { |
| 553 | err := client.Do(ctx, "SET", 10, 10).Err() |
| 554 | if err != nil { |
| 555 | b.Fatal(err) |
| 556 | } |
| 557 | } |
| 558 | }) |
| 559 | }) |
| 560 | } |
| 561 | |
| 562 | func BenchmarkClusterSetString(b *testing.B) { |
| 563 | if testing.Short() { |
nothing calls this directly
no test coverage detected