From 9acedf49243003e14f13504661e5126c2dc52355 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Thu, 28 Mar 2024 22:20:19 +0100 Subject: [PATCH] Fixes #2620 --- bazel/otel_cc_benchmark.bzl | 4 ++-- ci/do_ci.sh | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bazel/otel_cc_benchmark.bzl b/bazel/otel_cc_benchmark.bzl index 61e9fe8d69..cb181f83c3 100644 --- a/bazel/otel_cc_benchmark.bzl +++ b/bazel/otel_cc_benchmark.bzl @@ -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 @@ -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"], ) diff --git a/ci/do_ci.sh b/ci/do_ci.sh index 20bff53712..2b81a33626 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -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