From e36cc553ec82d38d5277fce66123b39add6bff7a Mon Sep 17 00:00:00 2001 From: siddontang Date: Tue, 28 Oct 2014 23:23:30 +0800 Subject: [PATCH] update benchmark --- cmd/ledis-benchmark/main.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cmd/ledis-benchmark/main.go b/cmd/ledis-benchmark/main.go index 1fe0c2d..02f56eb 100644 --- a/cmd/ledis-benchmark/main.go +++ b/cmd/ledis-benchmark/main.go @@ -29,9 +29,9 @@ func waitBench(cmd string, args ...interface{}) { c := client.Get() defer c.Close() - _, err := c.Do(cmd, args...) + _, err := c.Do(strings.ToUpper(cmd), args...) if err != nil { - fmt.Printf("do %s error %s", cmd, err.Error()) + fmt.Printf("do %s error %s\n", cmd, err.Error()) return } } @@ -88,7 +88,7 @@ func benchGet() { func benchRandGet() { f := func() { - n := rand.Int() + n := rand.Int() % *number waitBench("get", n) } @@ -172,7 +172,7 @@ func benchHGet() { func benchHRandGet() { f := func() { - n := rand.Int() + n := rand.Int() % *number waitBench("hget", "myhashkey", n) } @@ -288,8 +288,6 @@ func main() { runAll = false } - println(*tests, len(ts)) - needTest := make(map[string]struct{}) for _, s := range ts { needTest[strings.ToLower(s)] = struct{}{}