Skip to content

Commit

Permalink
feat(ch-log-bench-read): setup a flow for dump benchmarking
Browse files Browse the repository at this point in the history
  • Loading branch information
tdakkota committed Nov 30, 2024
1 parent 2639e7a commit f341ca4
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 48 deletions.
25 changes: 25 additions & 0 deletions dev/local/ch-log-bench-read/benchmark.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

echo ">> Benchmark"
start_time="2024-11-20T00:00:00Z"
end_time="2024-12-01T00:00:00Z"

queries_file="${BENCH_QUERIES:-testdata/logql.yml}"
benchmark_runs="${BENCH_RUNS:-15}"

OTEL_EXPORTER_OTLP_INSECURE="true" go run github.com/go-faster/oteldb/cmd/otelbench logql bench \
--start "$start_time" \
--end "$end_time" \
-i "$queries_file" \
-o report.yml \
--trace \
--allow-empty=false \
--count "$benchmark_runs"

echo ">> Analyze"
go run github.com/go-faster/oteldb/cmd/otelbench logql analyze \
--input report.yml \
--format benchstat >benchstat.report.txt

echo ">> Benchstat"
benchstat benchstat.report.txt
43 changes: 0 additions & 43 deletions dev/local/ch-log-bench-read/run.sh

This file was deleted.

14 changes: 14 additions & 0 deletions dev/local/ch-log-bench-read/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

set -e

echo ">> Setup oteldb locally"
docker compose up -d --remove-orphans --build

DUMP_DIR="${DUMP_DIR:-/tmp/slowdump}"

echo ">> Upload benchmark data"
go run github.com/go-faster/oteldb/cmd/otelbench dump restore \
--truncate \
--database default \
--input "${DUMP_DIR}"
10 changes: 5 additions & 5 deletions dev/local/ch-log-bench-read/testdata/logql.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
range:
- title: Failed POST requests
- title: Lookup by materialzied attribute
query: |-
{http_method="POST"} |= "Error"
series:
- title: All POST series
match: ['{http_method="POST"}']
{level!="DEBUG", service_name="go-faster.oteldb"}
- title: Lookup by regular attribute
query: |-
{operationName="SearchTagValuesV2"}

0 comments on commit f341ca4

Please sign in to comment.