Skip to content

Commit 13a4c45

Browse files
authored
[CI] Benchmark, provide units with --benchmark_min_time (#2621)
1 parent fabd8cc commit 13a4c45

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

bazel/otel_cc_benchmark.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def otel_cc_benchmark(name, srcs, deps, tags = [""]):
3737
tools = [":" + name],
3838
tags = tags + ["benchmark_result", "manual"],
3939
testonly = True,
40-
cmd = "$(location :" + name + (") --benchmark_format=json --benchmark_color=false --benchmark_min_time=.1 &> $@"),
40+
cmd = "$(location :" + name + (") --benchmark_format=json --benchmark_color=false --benchmark_min_time=.1s &> $@"),
4141
)
4242

4343
# This is run as part of "bazel test ..." to smoke-test benchmarks. It's
@@ -46,7 +46,7 @@ def otel_cc_benchmark(name, srcs, deps, tags = [""]):
4646
name = name + "_smoketest",
4747
srcs = srcs,
4848
deps = deps + ["@com_github_google_benchmark//:benchmark"],
49-
args = ["--benchmark_min_time=0"],
49+
args = ["--benchmark_min_time=1x"],
5050
tags = tags + ["benchmark"],
5151
defines = ["BAZEL_BUILD"],
5252
)

ci/do_ci.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ function run_benchmarks
4343
do
4444
out=$component-benchmark_result.json
4545
find ./$component -type f -name "*_result.json" -exec cat {} \; > $component_tmp_bench.json
46+
# Print each result in CI logs, so it can be inspected.
47+
echo "BENCHMARK result (begin)"
48+
cat $component_tmp_bench.json
49+
echo "BENCHMARK result (end)"
4650
cat $component_tmp_bench.json | docker run -i --rm itchyny/gojq:0.12.6 -s \
4751
'.[0].benchmarks = ([.[].benchmarks] | add) |
4852
if .[0].benchmarks == null then null else .[0] end' > $BENCHMARK_DIR/$out

0 commit comments

Comments
 (0)