Skip to main content

Module benchmark

Module benchmark 

Source
Expand description

Parse, pair, aggregate, compare, and report compact benchmark markers.

The normal pipeline is parse_benchmark_events, pair_benchmark_spans, aggregate_benchmark_spans, and optionally compare_benchmark_aggregates. Native report output lives in the repository’s benchmark_report example. Marker producers can use format_marker on the host or ic_testkit::performance in canister code.

Totals and run counts remain exact integers. Means use Metrics’ exact scaled integer projection, rounded down. Callers choose the scale and handle projection errors; reports use scale one in the original counter units. Comparisons retain current and previous means instead of percentage estimates.

Structs§

BenchmarkAggregateError
Overflow rejects the complete aggregation, without returning partial totals.
BenchmarkAggregateRow
Exact totals and extrema for one scope and span label.
BenchmarkAverages
Floor-rounded scaled means of exact aggregate totals and run counts.
BenchmarkComparisonRow
Current and previous measurements, preserving missing rows and measured zero.
BenchmarkCounters
Exact instruction and byte counters reported by a marker.
BenchmarkMeasurement
Run count and scaled means for one present comparison side.
BenchmarkParseReport
Parsed events, rejected markers and ignored log noise.
BenchmarkParserConfig
Marker prefixes, suite naming and noise handling selected by the caller.
BenchmarkSpan
Matched start/end markers with nonnegative counter differences.
BenchmarkSpanReport
Pairing result retaining unmatched and invalid markers.
InvalidBenchmarkSpan
Matched markers whose counters decreased.
MalformedBenchmarkMarker
Rejected marker and its parse diagnostic.
RawBenchmarkEvent
Parsed marker with its original stream and line provenance.

Enums§

BenchmarkAverageError
Why a benchmark’s scaled average cannot be represented.
BenchmarkComparisonError
A comparison refuses ambiguous row identities or unrepresentable means.
BenchmarkCounter
Counter whose aggregate cannot be represented.
BenchmarkEventKind
Whether a marker opens or closes a measured span.
BenchmarkEventSource
Stream from which a marker was collected.
BenchmarkMarkerError
A marker field cannot be represented in the line-oriented marker grammar.
BenchmarkScope
Structural identity of one suite or the cross-suite aggregate.
SuiteDerivation
How a marker label determines its suite.

Constants§

DEFAULT_PREFIX
Default prefix for benchmark marker lines.

Functions§

aggregate_benchmark_spans
Aggregate spans by named suite and across all suites.
compare_benchmark_aggregates
Pair current and previous means at the same caller-selected scale.
format_marker
Format one marker using the supplied prefix, label and counters.
pair_benchmark_spans
Pair markers by suite and label, using the most recent unmatched start.
pair_benchmark_spans_by_origin
Pair only markers with the same prefix, stream, suite and span label.
parse_benchmark_events
Parse markers without assigning a stream identity.
parse_benchmark_events_from_captured_output
Parse separately captured stdout and stderr.
parse_benchmark_events_from_source
Parse markers while retaining the supplied stream identity.
try_format_marker
Format one complete marker after admitting its prefix and start/end label.