Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Benchmark, provide units with --benchmark_min_time #2621

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bazel/otel_cc_benchmark.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def otel_cc_benchmark(name, srcs, deps, tags = [""]):
tools = [":" + name],
tags = tags + ["benchmark_result", "manual"],
testonly = True,
cmd = "$(location :" + name + (") --benchmark_format=json --benchmark_color=false --benchmark_min_time=.1 &> $@"),
cmd = "$(location :" + name + (") --benchmark_format=json --benchmark_color=false --benchmark_min_time=.1s &> $@"),
)

# This is run as part of "bazel test ..." to smoke-test benchmarks. It's
Expand All @@ -46,7 +46,7 @@ def otel_cc_benchmark(name, srcs, deps, tags = [""]):
name = name + "_smoketest",
srcs = srcs,
deps = deps + ["@com_github_google_benchmark//:benchmark"],
args = ["--benchmark_min_time=0"],
args = ["--benchmark_min_time=1x"],
tags = tags + ["benchmark"],
defines = ["BAZEL_BUILD"],
)
4 changes: 4 additions & 0 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ function run_benchmarks
do
out=$component-benchmark_result.json
find ./$component -type f -name "*_result.json" -exec cat {} \; > $component_tmp_bench.json
# Print each result in CI logs, so it can be inspected.
echo "BENCHMARK result (begin)"
cat $component_tmp_bench.json
echo "BENCHMARK result (end)"
cat $component_tmp_bench.json | docker run -i --rm itchyny/gojq:0.12.6 -s \
'.[0].benchmarks = ([.[].benchmarks] | add) |
if .[0].benchmarks == null then null else .[0] end' > $BENCHMARK_DIR/$out
Expand Down