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

Function BenchmarkClusterDoInt

bench_test.go:533–560  ·  bench_test.go::BenchmarkClusterDoInt
(b *testing.B)

Source from the content-addressed store, hash-verified

531}
532
533func 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
562func BenchmarkClusterSetString(b *testing.B) {
563 if testing.Short() {

Callers

nothing calls this directly

Calls 9

newClusterScenarioFunction · 0.85
configureClusterTopologyFunction · 0.85
redisClusterOptionsFunction · 0.85
newClusterClientMethod · 0.80
CloseMethod · 0.65
NextMethod · 0.65
ErrMethod · 0.65
DoMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected