Skip to content

Commit 69cbb10

Browse files
roypatpb8o
authored andcommitted
test: print benchmark numbers at end of benchmark test
This will allows us to keep track of the numbers Signed-off-by: Patrick Roy <[email protected]>
1 parent 3ea36e6 commit 69cbb10

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

.buildkite/pipeline_pr_no_block.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
optional_grp = group(
2828
"❓ Optional",
29-
"./tools/devtool -y test -c 1-10 -m 0 -- ../tests/integration_tests/ -m no_block_pr",
29+
"./tools/devtool -y test -c 1-10 -m 0 -- ../tests/integration_tests/ -m no_block_pr --log-cli-level=INFO",
3030
**defaults,
3131
)
3232

src/vmm/benches/cpu_templates.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub fn cpu_template_benchmark(c: &mut Criterion) {
4545

4646
criterion_group! {
4747
name = cpu_template_benches;
48-
config = Criterion::default().sample_size(200).output_directory(Path::new("../../build/vmm_benchmark/cpu_templates"));
48+
config = Criterion::default().sample_size(200);
4949
targets = cpu_template_benchmark
5050
}
5151

tests/integration_tests/performance/test_benchmarks.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# SPDX-License-Identifier: Apache-2.0
33
"""Optional benchmarks-do-not-regress test"""
44

5+
import json
6+
import logging
57
import os
68
import platform
79

@@ -11,6 +13,7 @@
1113
from host_tools.cargo_build import cargo
1214

1315
TARGET_BRANCH = os.environ.get("BUILDKITE_PULL_REQUEST_BASE_BRANCH") or "main"
16+
LOGGER = logging.getLogger(__name__)
1417

1518

1619
@pytest.mark.no_block_pr
@@ -41,6 +44,16 @@ def test_no_regression_relative_to_target_branch():
4144
if "Performance has regressed." in result
4245
)
4346

47+
for benchmark in os.listdir("../build/cargo_target/criterion"):
48+
with open(
49+
f"../build/cargo_target/criterion/{benchmark}/new/estimates.json",
50+
encoding="utf-8",
51+
) as file:
52+
data = json.load(file)
53+
average_ns = data["mean"]["point_estimate"]
54+
55+
LOGGER.info("%s mean: %iµs", benchmark, average_ns / 1000)
56+
4457
# If this string is anywhere in stdout, then at least one of our benchmarks
4558
# is now performing worse with the PR changes.
4659
assert not regressions_only, "\n" + regressions_only

0 commit comments

Comments
 (0)