Skip to main content

Crate krabka_parse_benches

Crate krabka_parse_benches 

Source
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 PerformanceRecord against the Contract it 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.
BenchmarkComparison
One benchmark’s variance-calibrated reference/candidate decision.
BenchmarkMetric
A single benchmark measurement in nanoseconds per iteration.
BenchmarkSummary
Aggregated benchmark summary document.
BenchmarkVerdict
Machine-readable verdict over repeated same-host benchmark runs.
NamedMetric
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.
ParseBenchesError
Errors encountered while parsing benchmark output.

Functions§

calibrated_tolerance
The relative change a comparison allows: multiplier times the larger of the two sides’ spreads, but never less than floor.
compare_summaries
Compare at least three repeated reference and candidate summaries.
format_rfc3339_utc
Formats a SystemTime as an ISO8601 / RFC3339 UTC string (YYYY-MM-DDTHH:MM:SSZ).
generate_summary
Generates a BenchmarkSummary from the provided command-line arguments.
median
The median of values; an even count averages the middle two. An empty values has no median, and gives NaN.
parse_bencher_file
Parses all benchmark metrics from a .txt file into the target map.
parse_bencher_line
Parses a single line of Criterion bencher output.
parse_benchmark_dir
Scans the given directory for all *.txt files and parses their benchmark metrics.
read_summaries
Read every JSON summary in directory, sorted by filename.
relative_mad
The median absolute deviation of values around center, as a ratio of center.
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.