forked from mirror/ledisdb
update benchmark
This commit is contained in:
parent
fdeda83a37
commit
e36cc553ec
|
@ -29,9 +29,9 @@ func waitBench(cmd string, args ...interface{}) {
|
||||||
c := client.Get()
|
c := client.Get()
|
||||||
defer c.Close()
|
defer c.Close()
|
||||||
|
|
||||||
_, err := c.Do(cmd, args...)
|
_, err := c.Do(strings.ToUpper(cmd), args...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("do %s error %s", cmd, err.Error())
|
fmt.Printf("do %s error %s\n", cmd, err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ func benchGet() {
|
||||||
|
|
||||||
func benchRandGet() {
|
func benchRandGet() {
|
||||||
f := func() {
|
f := func() {
|
||||||
n := rand.Int()
|
n := rand.Int() % *number
|
||||||
waitBench("get", n)
|
waitBench("get", n)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ func benchHGet() {
|
||||||
|
|
||||||
func benchHRandGet() {
|
func benchHRandGet() {
|
||||||
f := func() {
|
f := func() {
|
||||||
n := rand.Int()
|
n := rand.Int() % *number
|
||||||
waitBench("hget", "myhashkey", n)
|
waitBench("hget", "myhashkey", n)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,8 +288,6 @@ func main() {
|
||||||
runAll = false
|
runAll = false
|
||||||
}
|
}
|
||||||
|
|
||||||
println(*tests, len(ts))
|
|
||||||
|
|
||||||
needTest := make(map[string]struct{})
|
needTest := make(map[string]struct{})
|
||||||
for _, s := range ts {
|
for _, s := range ts {
|
||||||
needTest[strings.ToLower(s)] = struct{}{}
|
needTest[strings.ToLower(s)] = struct{}{}
|
||||||
|
|
Loading…
Reference in New Issue