summaryrefslogtreecommitdiffhomepage
path: root/test/benchmarks/tools/redis.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/benchmarks/tools/redis.go')
-rw-r--r--test/benchmarks/tools/redis.go23
1 files changed, 17 insertions, 6 deletions
diff --git a/test/benchmarks/tools/redis.go b/test/benchmarks/tools/redis.go
index e35886437..12fdbc7cc 100644
--- a/test/benchmarks/tools/redis.go
+++ b/test/benchmarks/tools/redis.go
@@ -19,7 +19,6 @@ import (
"net"
"regexp"
"strconv"
- "strings"
"testing"
)
@@ -29,17 +28,29 @@ type Redis struct {
}
// MakeCmd returns a redis-benchmark client command.
-func (r *Redis) MakeCmd(ip net.IP, port int) []string {
+func (r *Redis) MakeCmd(ip net.IP, port, requests int) []string {
// There is no -t PING_BULK for redis-benchmark, so adjust the command in that case.
// Note that "ping" will run both PING_INLINE and PING_BULK.
if r.Operation == "PING_BULK" {
- return strings.Split(
- fmt.Sprintf("redis-benchmark --csv -t ping -h %s -p %d", ip, port), " ")
+ return []string{
+ "redis-benchmark",
+ "--csv",
+ "-t", "ping",
+ "-h", ip.String(),
+ "-p", fmt.Sprintf("%d", port),
+ "-n", fmt.Sprintf("%d", requests),
+ }
}
// runs redis-benchmark -t operation for 100K requests against server.
- return strings.Split(
- fmt.Sprintf("redis-benchmark --csv -t %s -h %s -p %d", r.Operation, ip, port), " ")
+ return []string{
+ "redis-benchmark",
+ "--csv",
+ "-t", r.Operation,
+ "-h", ip.String(),
+ "-p", fmt.Sprintf("%d", port),
+ "-n", fmt.Sprintf("%d", requests),
+ }
}
// Report parses output from redis-benchmark client and reports metrics.