From c5422c393e041c3d3b52e1f802771d8d2ba43fd0 Mon Sep 17 00:00:00 2001 From: tdakkota Date: Tue, 18 Jun 2024 03:36:31 +0300 Subject: [PATCH] feat(ch-bench-read): add option to set benchmark runs --- dev/local/ch-bench-read/README.md | 7 +++++-- dev/local/ch-bench-read/run.sh | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dev/local/ch-bench-read/README.md b/dev/local/ch-bench-read/README.md index 328585bc..10fb7688 100644 --- a/dev/local/ch-bench-read/README.md +++ b/dev/local/ch-bench-read/README.md @@ -4,13 +4,16 @@ To run benchmarks, use `run.sh` script. # Comparing changes +To set queries file, use `BENCH_QUERIES` environment variable. +To set number of benchmark runs, use `BENCH_RUNS` environment variable. + Checkout base commit or `git stash push` current changes. ### Run benchmark on base ```console $ cd dev/local/ch-bench-read -$ ./run.sh +$ BENCH_QUERIES=bench-series.yml ./run.sh ``` Then save result in benchstat format: @@ -22,7 +25,7 @@ $ go run github.com/go-faster/oteldb/cmd/otelbench promql analyze -f 'benchstat' ### Run benchmark on changes ```console -$ ./run.sh +$ BENCH_QUERIES=bench-series.yml ./run.sh $ go run github.com/go-faster/oteldb/cmd/otelbench promql analyze -f 'benchstat' -i report.yml | tee bench.new.txt ``` diff --git a/dev/local/ch-bench-read/run.sh b/dev/local/ch-bench-read/run.sh index 17575513..84797552 100755 --- a/dev/local/ch-bench-read/run.sh +++ b/dev/local/ch-bench-read/run.sh @@ -24,13 +24,15 @@ go run github.com/go-faster/oteldb/cmd/otelbench promql bench \ -i "$queries_file" \ --warmup 10 +benchmark_runs="${BENCH_RUNS:-15}" + echo ">> Benchmark" OTEL_EXPORTER_OTLP_INSECURE="true" go run github.com/go-faster/oteldb/cmd/otelbench promql bench \ -i "$queries_file" \ -o report.yml \ --trace \ --allow-empty=false \ - --count 5 \ + --count "$benchmark_runs" \ --warmup 5 echo ">> Done"