mirror of https://github.com/grafana/loki
more tsdb benchmarks + updates script to work with incompatible branches (#5590)
* more tsdb benchmarks + updates script to work with incompatible branches * shellcheckpull/5593/head
parent
d2ce08280f
commit
67f961e4dc
@ -1,18 +1,32 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
old=$1 |
||||
new=$2 |
||||
# This can be run like: |
||||
# ./tools/tsdb/tsdb-map/diff.sh /tmp/loki-scratch/loki-ops-daily.r main $(git rev-parse --abbrev-ref HEAD) |
||||
|
||||
boltdb_base=$1 |
||||
branch_a=$2 |
||||
branch_b=$3 |
||||
|
||||
echo building from "${branch_a}" |
||||
git checkout "${branch_a}" |
||||
go run tools/tsdb/tsdb-map/main.go -source "${boltdb_base}" -dest /tmp/loki-tsdb-a |
||||
echo benchmarking "${branch_a}" |
||||
LOKI_TSDB_PATH=/tmp/loki-tsdb-a go test github.com/grafana/loki/tools/tsdb/tsdb-map -bench=BenchmarkQuery -run '^$' -benchmem > /tmp/loki-tsdb-bench-a |
||||
|
||||
echo building from "${branch_b}" |
||||
git checkout "${branch_b}" |
||||
go run tools/tsdb/tsdb-map/main.go -source "${boltdb_base}" -dest /tmp/loki-tsdb-b |
||||
echo benchmarking "${branch_b}" |
||||
LOKI_TSDB_PATH=/tmp/loki-tsdb-b go test github.com/grafana/loki/tools/tsdb/tsdb-map -bench=BenchmarkQuery -run '^$' -benchmem > /tmp/loki-tsdb-bench-b |
||||
|
||||
|
||||
echo benchmarks: |
||||
echo |
||||
|
||||
benchstat \ |
||||
<(LOKI_TSDB_PATH="${old}" go test github.com/grafana/loki/tools/tsdb/tsdb-map -bench=BenchmarkQuery -run '^$' -benchmem) \ |
||||
<(LOKI_TSDB_PATH="${new}" go test github.com/grafana/loki/tools/tsdb/tsdb-map -bench=BenchmarkQuery -run '^$' -benchmem) |
||||
benchstat /tmp/loki-tsdb-bench-a /tmp/loki-tsdb-bench-b |
||||
|
||||
echo |
||||
echo sizing: |
||||
echo |
||||
|
||||
ls -lh "${old}" |
||||
ls -lh "${new}" |
||||
ls -lh /tmp/loki-tsdb-a |
||||
ls -lh /tmp/loki-tsdb-b |
||||
|
Loading…
Reference in new issue