Skip to content

roachprod-microbench, testutils: lint benchdocs#162595

Draft
herkolategan wants to merge 2 commits intocockroachdb:masterfrom
herkolategan:hbl/roachprod-microbench-bench-configs
Draft

roachprod-microbench, testutils: lint benchdocs#162595
herkolategan wants to merge 2 commits intocockroachdb:masterfrom
herkolategan:hbl/roachprod-microbench-bench-configs

Conversation

@herkolategan
Copy link
Collaborator

No description provided.

Previously, if an engineer added args to their benchmark documentation,
there was no validation to ensure the formatting was correct. This PR
moves the benchmark doc args parsing to a shared utility in testutils
and also adds a linter to verify all benchmark docs.

This takes the guessing out of adding a benchmark doc and hoping for the
best when the weekly microbenchmarks run.

The weekly job will use the lenient mode, with the expectation that any
merged code (benchmark docs) would have gone through the linter.

Epic: None
Release Note: None
Previously, roachprod-microbench had no way to pass per-benchmark
configuration (such as benchtime) when executing benchmarks. All
benchmarks ran with the same default arguments regardless of their
benchmark-ci documentation annotations.

This change adds:

- CompareArgs to BenchmarkInfo, supporting `post` (none/blocker) and
  `threshold` (0.0-1.0) configuration keys in benchmark-ci annotations.
- JSON serialization tags on BenchmarkInfo, RunArgs, and CompareArgs to
  support import/export of benchmark configurations.
- A `--export` flag on the `list` command to export the benchmark list
  to a JSON file.
- A `--benchmark-config` flag on the `run` command to load a JSON
  benchmark config and apply per-benchmark settings (e.g. benchtime)
  when generating test commands.

Not all the `CompareArgs` and `RunArgs` are functional, yet, this will
be implemented in a follow-up PR.

Epic: None
Release note: None
@trunk-io
Copy link
Contributor

trunk-io bot commented Feb 6, 2026

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@cockroach-teamcity
Copy link
Member

🔴 Sysbench [SQL, 3node, oltp_read_write]
Metric Old Commit New Commit Delta Note
🔴 sec/op 9.344m ±1% 9.427m ±1% +0.89% p=0.010 n=15
allocs/op 7.988k ±0% 7.981k ±0% ~ p=0.280 n=15
Reproduce

benchdiff binaries:

mkdir -p benchdiff/69a0cb2/bin/1058449141
gcloud storage cp gs://cockroach-microbench-ci/builds/69a0cb280706e3c61f4974f364bbf3408909d6e8/bin/pkg_sql_tests benchdiff/69a0cb2/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests
chmod +x benchdiff/69a0cb2/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests
mkdir -p benchdiff/f275471/bin/1058449141
gcloud storage cp gs://cockroach-microbench-ci/builds/f2754717ca1ec136f609fdfa5ca779e0fbf120e1/bin/pkg_sql_tests benchdiff/f275471/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests
chmod +x benchdiff/f275471/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests

benchdiff command:

benchdiff --run=^BenchmarkSysbench/SQL/3node/oltp_read_write$ --old=f275471 --new=69a0cb2 ./pkg/sql/tests
⚪ Sysbench [KV, 3node, oltp_read_only]
Metric Old Commit New Commit Delta Note
sec/op 2.996m ±1% 3.015m ±1% ~ p=0.137 n=15
allocs/op 2.103k ±0% 2.103k ±0% ~ p=0.585 n=15
Reproduce

benchdiff binaries:

mkdir -p benchdiff/69a0cb2/bin/1058449141
gcloud storage cp gs://cockroach-microbench-ci/builds/69a0cb280706e3c61f4974f364bbf3408909d6e8/bin/pkg_sql_tests benchdiff/69a0cb2/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests
chmod +x benchdiff/69a0cb2/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests
mkdir -p benchdiff/f275471/bin/1058449141
gcloud storage cp gs://cockroach-microbench-ci/builds/f2754717ca1ec136f609fdfa5ca779e0fbf120e1/bin/pkg_sql_tests benchdiff/f275471/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests
chmod +x benchdiff/f275471/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests

benchdiff command:

benchdiff --run=^BenchmarkSysbench/KV/3node/oltp_read_only$ --old=f275471 --new=69a0cb2 ./pkg/sql/tests
⚪ Sysbench [KV, 3node, oltp_write_only]
Metric Old Commit New Commit Delta Note
sec/op 2.688m ±2% 2.676m ±1% ~ p=0.653 n=15
allocs/op 4.144k ±0% 4.145k ±0% ~ p=0.720 n=15
Reproduce

benchdiff binaries:

mkdir -p benchdiff/69a0cb2/bin/1058449141
gcloud storage cp gs://cockroach-microbench-ci/builds/69a0cb280706e3c61f4974f364bbf3408909d6e8/bin/pkg_sql_tests benchdiff/69a0cb2/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests
chmod +x benchdiff/69a0cb2/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests
mkdir -p benchdiff/f275471/bin/1058449141
gcloud storage cp gs://cockroach-microbench-ci/builds/f2754717ca1ec136f609fdfa5ca779e0fbf120e1/bin/pkg_sql_tests benchdiff/f275471/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests
chmod +x benchdiff/f275471/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests

benchdiff command:

benchdiff --run=^BenchmarkSysbench/KV/3node/oltp_write_only$ --old=f275471 --new=69a0cb2 ./pkg/sql/tests
Artifacts

download:

mkdir -p new
gcloud storage cp gs://cockroach-microbench-ci/artifacts/69a0cb280706e3c61f4974f364bbf3408909d6e8/21755070543-1/\* new/
mkdir -p old
gcloud storage cp gs://cockroach-microbench-ci/artifacts/f2754717ca1ec136f609fdfa5ca779e0fbf120e1/21755070543-1/\* old/

built with commit: 69a0cb280706e3c61f4974f364bbf3408909d6e8

@cockroach-teamcity cockroach-teamcity added the X-perf-check Microbenchmarks CI: Added to a PR if a performance regression is detected and should be checked label Feb 6, 2026
@cockroach-teamcity
Copy link
Member

⚪ Sysbench [SQL, 3node, oltp_read_write]
Metric Old Commit New Commit Delta Note
sec/op 9.671m ±1% 9.709m ±1% ~ p=0.461 n=15
allocs/op 7.971k ±0% 7.970k ±0% ~ p=0.767 n=15
Reproduce

benchdiff binaries:

mkdir -p benchdiff/69a0cb2/bin/1058449141
gcloud storage cp gs://cockroach-microbench-ci/builds/69a0cb280706e3c61f4974f364bbf3408909d6e8/bin/pkg_sql_tests benchdiff/69a0cb2/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests
chmod +x benchdiff/69a0cb2/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests
mkdir -p benchdiff/f275471/bin/1058449141
gcloud storage cp gs://cockroach-microbench-ci/builds/f2754717ca1ec136f609fdfa5ca779e0fbf120e1/bin/pkg_sql_tests benchdiff/f275471/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests
chmod +x benchdiff/f275471/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests

benchdiff command:

benchdiff --run=^BenchmarkSysbench/SQL/3node/oltp_read_write$ --old=f275471 --new=69a0cb2 ./pkg/sql/tests
⚪ Sysbench [KV, 3node, oltp_read_only]
Metric Old Commit New Commit Delta Note
sec/op 3.031m ±1% 3.052m ±1% ~ p=0.148 n=15
allocs/op 2.103k ±0% 2.103k ±0% ~ p=0.982 n=15
Reproduce

benchdiff binaries:

mkdir -p benchdiff/69a0cb2/bin/1058449141
gcloud storage cp gs://cockroach-microbench-ci/builds/69a0cb280706e3c61f4974f364bbf3408909d6e8/bin/pkg_sql_tests benchdiff/69a0cb2/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests
chmod +x benchdiff/69a0cb2/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests
mkdir -p benchdiff/f275471/bin/1058449141
gcloud storage cp gs://cockroach-microbench-ci/builds/f2754717ca1ec136f609fdfa5ca779e0fbf120e1/bin/pkg_sql_tests benchdiff/f275471/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests
chmod +x benchdiff/f275471/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests

benchdiff command:

benchdiff --run=^BenchmarkSysbench/KV/3node/oltp_read_only$ --old=f275471 --new=69a0cb2 ./pkg/sql/tests
⚪ Sysbench [KV, 3node, oltp_write_only]
Metric Old Commit New Commit Delta Note
sec/op 2.801m ±1% 2.809m ±1% ~ p=0.305 n=15
allocs/op 4.156k ±0% 4.156k ±0% ~ p=0.479 n=15
Reproduce

benchdiff binaries:

mkdir -p benchdiff/69a0cb2/bin/1058449141
gcloud storage cp gs://cockroach-microbench-ci/builds/69a0cb280706e3c61f4974f364bbf3408909d6e8/bin/pkg_sql_tests benchdiff/69a0cb2/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests
chmod +x benchdiff/69a0cb2/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests
mkdir -p benchdiff/f275471/bin/1058449141
gcloud storage cp gs://cockroach-microbench-ci/builds/f2754717ca1ec136f609fdfa5ca779e0fbf120e1/bin/pkg_sql_tests benchdiff/f275471/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests
chmod +x benchdiff/f275471/bin/1058449141/cockroachdb_cockroach_pkg_sql_tests

benchdiff command:

benchdiff --run=^BenchmarkSysbench/KV/3node/oltp_write_only$ --old=f275471 --new=69a0cb2 ./pkg/sql/tests
Artifacts

download:

mkdir -p new
gcloud storage cp gs://cockroach-microbench-ci/artifacts/69a0cb280706e3c61f4974f364bbf3408909d6e8/21755070543-2/\* new/
mkdir -p old
gcloud storage cp gs://cockroach-microbench-ci/artifacts/f2754717ca1ec136f609fdfa5ca779e0fbf120e1/21755070543-2/\* old/

built with commit: 69a0cb280706e3c61f4974f364bbf3408909d6e8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

X-perf-check Microbenchmarks CI: Added to a PR if a performance regression is detected and should be checked

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants