From 0a61b949e279e6b6f5ccb009229dd3a16c6379e8 Mon Sep 17 00:00:00 2001 From: siddontang Date: Thu, 23 Oct 2014 13:49:43 +0800 Subject: [PATCH] bench add kv value size flag --- cmd/ledis-benchmark/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/ledis-benchmark/main.go b/cmd/ledis-benchmark/main.go index 9948f5b..379f6f9 100644 --- a/cmd/ledis-benchmark/main.go +++ b/cmd/ledis-benchmark/main.go @@ -18,7 +18,7 @@ var clients = flag.Int("c", 50, "number of clients") var reverse = flag.Bool("rev", false, "enable zset rev benchmark") var round = flag.Int("r", 1, "benchmark round number") var del = flag.Bool("del", true, "enable del benchmark") - +var valueSize = flag.Int("vsize", 100, "kv value size") var wg sync.WaitGroup var client *ledis.Client @@ -65,7 +65,7 @@ var kvDelBase int64 = 0 func benchSet() { f := func() { - value := make([]byte, 100) + value := make([]byte, *valueSize) crand.Read(value) n := atomic.AddInt64(&kvSetBase, 1) waitBench("set", n, value) @@ -103,7 +103,7 @@ func benchDel() { func benchPushList() { f := func() { - value := make([]byte, 10) + value := make([]byte, 100) crand.Read(value) waitBench("rpush", "mytestlist", value) }