update redbench

This commit is contained in:
Josh Baker 2017-09-30 13:07:39 -07:00
parent 1780badf1b
commit 033f782a84
2 changed files with 10 additions and 5 deletions

View File

@ -4,8 +4,9 @@
Redbench is a Go package that allows for bootstrapping benchmarks Redbench is a Go package that allows for bootstrapping benchmarks
for servers using a custom implementation of the Redis protocol. It provides for servers using a custom implementation of the Redis protocol. It provides
the same inputs and outputs as the the same inputs and outputs as the
[redis-benchmark](https://redis.io/topics/benchmarks) tool. The purpose of [redis-benchmark](https://redis.io/topics/benchmarks) tool.
this library is to provide benchmarking for
The purpose of this library is to provide benchmarking for
[Redcon](https://github.com/tidwall/redcon) compatible servers such as [Redcon](https://github.com/tidwall/redcon) compatible servers such as
[Tile38](https://github.com/tidwall/tile38), but also works well for Redis [Tile38](https://github.com/tidwall/tile38), but also works well for Redis
operations that are not covered by the `redis-benchmark` tool such as the operations that are not covered by the `redis-benchmark` tool such as the
@ -65,12 +66,14 @@ func main() {
} }
``` ```
The operations is like as executing, but without the `GEO*` commands. Which is similar to executing:
``` ```
$ redis-benchmark -t PING,SET,GET $ redis-benchmark -t PING,SET,GET
``` ```
For a more complete example, check out [tile38-benchmark](https://github.com/tidwall/tile38/blob/master/cmd/tile38-benchmark/main.go) from the [Tile38](https://github.com/tidwall/tile38) project.
### Custom Options ### Custom Options
```go ```go

View File

@ -30,8 +30,10 @@ func readResp(rd *bufio.Reader, n int) error {
if err != nil { if err != nil {
return err return err
} }
if _, err = io.CopyN(ioutil.Discard, rd, n+2); err != nil { if n >= 0 {
return err if _, err = io.CopyN(ioutil.Discard, rd, n+2); err != nil {
return err
}
} }
case '*': case '*':
n, err := strconv.ParseInt(string(line[1:len(line)-2]), 10, 64) n, err := strconv.ParseInt(string(line[1:len(line)-2]), 10, 64)