Skip to content

Commit

Permalink
feat(ch-bench-read): add option to set benchmark runs
Browse files Browse the repository at this point in the history
  • Loading branch information
tdakkota committed Jun 18, 2024
1 parent 6570691 commit c5422c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions dev/local/ch-bench-read/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
```

Expand Down
4 changes: 3 additions & 1 deletion dev/local/ch-bench-read/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit c5422c3

Please sign in to comment.