mirror of https://github.com/tidwall/tile38.git
distinct benchmark types
the -t flag now supports set-point, set-rect, and set-string
This commit is contained in:
parent
cb062bded4
commit
91c44a5eef
cmd/tile38-benchmark
|
@ -177,7 +177,7 @@ func main() {
|
|||
return redbench.AppendCommand(buf, "PING")
|
||||
},
|
||||
)
|
||||
case "SET":
|
||||
case "SET", "SET-POINT", "SET-RECT", "SET-STRING":
|
||||
if redis {
|
||||
redbench.Bench("SET", addr, fillOpts(), prepFn,
|
||||
func(buf []byte) []byte {
|
||||
|
@ -186,6 +186,8 @@ func main() {
|
|||
)
|
||||
} else {
|
||||
var i int64
|
||||
switch strings.ToUpper(strings.TrimSpace(test)) {
|
||||
case "SET", "SET-POINT":
|
||||
redbench.Bench("SET (point)", addr, fillOpts(), prepFn,
|
||||
func(buf []byte) []byte {
|
||||
i := atomic.AddInt64(&i, 1)
|
||||
|
@ -196,6 +198,9 @@ func main() {
|
|||
)
|
||||
},
|
||||
)
|
||||
}
|
||||
switch strings.ToUpper(strings.TrimSpace(test)) {
|
||||
case "SET", "SET-RECT":
|
||||
redbench.Bench("SET (rect)", addr, fillOpts(), prepFn,
|
||||
func(buf []byte) []byte {
|
||||
i := atomic.AddInt64(&i, 1)
|
||||
|
@ -208,6 +213,9 @@ func main() {
|
|||
)
|
||||
},
|
||||
)
|
||||
}
|
||||
switch strings.ToUpper(strings.TrimSpace(test)) {
|
||||
case "SET", "SET-STRING":
|
||||
redbench.Bench("SET (string)", addr, fillOpts(), prepFn,
|
||||
func(buf []byte) []byte {
|
||||
i := atomic.AddInt64(&i, 1)
|
||||
|
@ -215,6 +223,7 @@ func main() {
|
|||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
case "GET":
|
||||
if redis {
|
||||
redbench.Bench("GET", addr, fillOpts(), prepFn,
|
||||
|
|
Loading…
Reference in New Issue