(b *testing.B)
| 560 | } |
| 561 | |
| 562 | func BenchmarkClusterSetString(b *testing.B) { |
| 563 | if testing.Short() { |
| 564 | b.Skip("skipping in short mode") |
| 565 | } |
| 566 | |
| 567 | ctx := context.Background() |
| 568 | if clusterBench == nil { |
| 569 | clusterBench = newClusterScenario() |
| 570 | if err := configureClusterTopology(ctx, clusterBench); err != nil { |
| 571 | b.Fatal(err) |
| 572 | } |
| 573 | } |
| 574 | |
| 575 | client := clusterBench.newClusterClient(ctx, redisClusterOptions()) |
| 576 | defer client.Close() |
| 577 | |
| 578 | value := string(bytes.Repeat([]byte{'1'}, 10000)) |
| 579 | |
| 580 | b.Run("cluster set string", func(b *testing.B) { |
| 581 | b.ResetTimer() |
| 582 | |
| 583 | b.RunParallel(func(pb *testing.PB) { |
| 584 | for pb.Next() { |
| 585 | err := client.Set(ctx, "key", value, 0).Err() |
| 586 | if err != nil { |
| 587 | b.Fatal(err) |
| 588 | } |
| 589 | } |
| 590 | }) |
| 591 | }) |
| 592 | } |
| 593 | |
| 594 | func BenchmarkExecRingSetAddrsCmd(b *testing.B) { |
| 595 | const ( |
nothing calls this directly
no test coverage detected