diff --git a/vendor/github.com/tidwall/redbench/README.md b/vendor/github.com/tidwall/redbench/README.md index 28d3e6a7..db283125 100644 --- a/vendor/github.com/tidwall/redbench/README.md +++ b/vendor/github.com/tidwall/redbench/README.md @@ -4,8 +4,9 @@ Redbench is a Go package that allows for bootstrapping benchmarks for servers using a custom implementation of the Redis protocol. It provides the same inputs and outputs as the -[redis-benchmark](https://redis.io/topics/benchmarks) tool. The purpose of -this library is to provide benchmarking for +[redis-benchmark](https://redis.io/topics/benchmarks) tool. + +The purpose of this library is to provide benchmarking for [Redcon](https://github.com/tidwall/redcon) compatible servers such as [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 @@ -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 ``` +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 ```go diff --git a/vendor/github.com/tidwall/redbench/bench.go b/vendor/github.com/tidwall/redbench/bench.go index 8403497c..9f7b4e9e 100644 --- a/vendor/github.com/tidwall/redbench/bench.go +++ b/vendor/github.com/tidwall/redbench/bench.go @@ -30,8 +30,10 @@ func readResp(rd *bufio.Reader, n int) error { if err != nil { return err } - if _, err = io.CopyN(ioutil.Discard, rd, n+2); err != nil { - return err + if n >= 0 { + if _, err = io.CopyN(ioutil.Discard, rd, n+2); err != nil { + return err + } } case '*': n, err := strconv.ParseInt(string(line[1:len(line)-2]), 10, 64)