Reduce number of operations in Redis benchmark.

The redis benchmark has inconsistent data due to timeouts. In general,
operations on a redis DB are pretty uniform WRT performance and having
a large set of operations is not useful for regression checks.

Add another test method with a smaller subset of operations and a filter in
the buildkite pipeline files.

PiperOrigin-RevId: 499574468
This commit is contained in:
Zach Koopmans
2023-01-04 14:11:07 -08:00
committed by gVisor bot
parent f75c1470c9
commit 0926a58934
2 changed files with 12 additions and 3 deletions
+1 -1
View File
@@ -494,7 +494,7 @@ steps:
command: make -i benchmark-platforms BENCHMARKS_SUITE=node BENCHMARKS_TARGETS=test/benchmarks/network:node_test
- <<: *benchmarks
label: ":redis: Redis benchmarks"
command: make -i benchmark-platforms BENCHMARKS_SUITE=redis BENCHMARKS_TARGETS=test/benchmarks/database:redis_test BENCHMARKS_OPTIONS=-test.benchtime=15s
command: make -i benchmark-platforms BENCHMARKS_SUITE=redis BENCHMARKS_TARGETS=test/benchmarks/database:redis_test BENCHMARKS_FILTER=BenchmarkRedis/operation
- <<: *benchmarks
label: ":ruby: Ruby benchmarks"
command: make -i benchmark-platforms BENCHMARKS_SUITE=ruby BENCHMARKS_TARGETS=test/benchmarks/network:ruby_test
+11 -2
View File
@@ -48,9 +48,18 @@ var operations []string = []string{
"MSET",
}
// BenchmarkRedis runs redis-benchmark against a redis instance and reports
// BenchmarkAllRedisOperations runs redis-benchmark against a redis instance and reports
// data in queries per second. Each is reported by named operation (e.g. LPUSH).
func BenchmarkAllRedisOperations(b *testing.B) {
doBenchmarkRedis(b, operations)
}
// BenchmarkRedisDashboard runs a subset of redis benchmarks for the performance dashboard.
func BenchmarkRedis(b *testing.B) {
doBenchmarkRedis(b, []string{"SET", "LPUSH", "LRANGE_100"})
}
func doBenchmarkRedis(b *testing.B, ops []string) {
clientMachine, err := harness.GetMachine()
if err != nil {
b.Fatalf("failed to get machine: %v", err)
@@ -84,7 +93,7 @@ func BenchmarkRedis(b *testing.B) {
if err = harness.WaitUntilContainerServing(ctx, clientMachine, server, port); err != nil {
b.Fatalf("failed to start redis with: %v", err)
}
for _, operation := range operations {
for _, operation := range ops {
param := tools.Parameter{
Name: "operation",
Value: operation,