diff --git a/cmd/tile38-benchmark/main.go b/cmd/tile38-benchmark/main.go index f0f0b931..eec903ba 100644 --- a/cmd/tile38-benchmark/main.go +++ b/cmd/tile38-benchmark/main.go @@ -261,7 +261,7 @@ func main() { ) } - case "SET", "SET-POINT", "SET-RECT", "SET-STRING": + case "SET", "SET-POINT", "SET-RECT", "SET-LINE", "SET-STRING": if redis { redbench.Bench("SET", addr, opts, prepFn, func(buf []byte) []byte { @@ -299,6 +299,22 @@ func main() { ) } switch strings.ToUpper(strings.TrimSpace(test)) { + case "SET", "SET-LINE": + redbench.Bench("SET (line)", addr, opts, prepFn, + func(buf []byte) []byte { + i := atomic.AddInt64(&i, 1) + alat, alon, blat, blon := randRect(10000) + if rand.Int()%2 == 0 { + alat, alon, blat, blon = blat, blon, alat, alon + } + linestring := fmt.Sprintf(`{"type":"LineString","coordinates":[[%f,%f],[%f,%f]]}`, alon, alat, blon, blat) + return redbench.AppendCommand(buf, "SET", "key:bench", "id:"+strconv.FormatInt(i, 10), "OBJECT", + linestring, + ) + }, + ) + } + switch strings.ToUpper(strings.TrimSpace(test)) { case "SET", "SET-STRING": redbench.Bench("SET (string)", addr, opts, prepFn, func(buf []byte) []byte {