Expand description
Parses Criterion benchmark output in bencher format into structured JSON summaries, and judges repeated reference/candidate measurements against variance-calibrated budgets.
Two lanes share one set of statistics. The criterion lane compares
BenchmarkSummary files with compare_summaries. The broker
performance lane judges a record::PerformanceRecord against a
contract::Contract with budget::evaluate. Both take medians over
repeated runs and allow the larger of a fixed floor and a multiple of the
relative median absolute deviation: calibrated_tolerance.
Each criterion summary also names the bench executables its pass ran, as
executables verified them, so a verdict says which binaries produced
its numbers.
Note: If a shared krabka-tools repository is established across the
krabka-io organization, this crate can be migrated there as a common
benchmark utility for krabka-broker, krabka-protocol, and krabka-client-rs.
Modules§
- budget
- The budget evaluator: judge a
PerformanceRecordagainst theContractit was measured under. - contract
- The regression contract: the workload matrix and the budgets that a performance comparison is judged by.
- executables
- Which compiled benchmark executables a measurement pass ran.
- record
- The performance record: every raw trial of one comparison, with the provenance needed to reproduce it.
- render
- Render a record and its verdict as the Markdown that is published.
Structs§
- Args
- CLI configuration arguments for parsing benchmarks.
- Benchmark
Comparison - One benchmark’s variance-calibrated reference/candidate decision.
- Benchmark
Metric - A single benchmark measurement in nanoseconds per iteration.
- Benchmark
Summary - Aggregated benchmark summary document.
- Benchmark
Verdict - Machine-readable verdict over repeated same-host benchmark runs.
- Named
Metric - A benchmark measurement together with the name of the benchmark it belongs to, as read from one line of bencher output.
Enums§
- Command
- The commands besides parsing and comparing criterion output.
- Parse
Benches Error - Errors encountered while parsing benchmark output.
Functions§
- calibrated_
tolerance - The relative change a comparison allows:
multipliertimes the larger of the two sides’ spreads, but never less thanfloor. - compare_
summaries - Compare at least three repeated reference and candidate summaries.
- format_
rfc3339_ utc - Formats a
SystemTimeas an ISO8601 / RFC3339 UTC string (YYYY-MM-DDTHH:MM:SSZ). - generate_
summary - Generates a
BenchmarkSummaryfrom the provided command-line arguments. - median
- The median of
values; an even count averages the middle two. An emptyvalueshas no median, and gives NaN. - parse_
bencher_ file - Parses all benchmark metrics from a
.txtfile into the target map. - parse_
bencher_ line - Parses a single line of Criterion bencher output.
- parse_
benchmark_ dir - Scans the given directory for all
*.txtfiles and parses their benchmark metrics. - read_
summaries - Read every JSON summary in
directory, sorted by filename. - relative_
mad - The median absolute deviation of
valuesaroundcenter, as a ratio ofcenter. - resolve_
commit_ sha - Resolves commit SHA from an optional CLI argument, falling back to an optional environment SHA.
- run_
command - Run one subcommand and say what it found.
- run_
from_ args - Executes benchmark parsing and writes the resulting JSON summary to disk.