Expand description
Temporal-assertion patterns over a periodic
SampleSeries.
SeriesField<T> is a per-sample column extracted from the
series via SampleSeries::bpf or SampleSeries::stats (or
the typed bpf_map / stats_path projectors). It carries a
parallel (tag, elapsed_ms, SnapshotResult<T>) triple per
sample so any failure-path message can name the offending tag
and timestamp without re-walking the source data.
The seven built-in patterns are:
nondecreasing— counter monotonicity (v[i] <= v[i+1]).strictly_increasing— strict counter monotonicity (v[i] < v[i+1]).rate_within(lo, hi)— bounded delta-per-millisecond between consecutive samples.steady_within(warmup, tolerance)— post-warmup samples stay inside[mean·(1-tol), mean·(1+tol)].converges_to(target, tol, deadline_ms)— three consecutive samples land inside[target-tol, target+tol]at or beforedeadline_ms.always_true— boolean invariant at every sample (SeriesField<bool>only).ratio_within(other, lo, hi)— cross-field correlation between two same-length series.
Per-sample scalar checks bypass the temporal patterns via
SeriesField::each, which yields an EachClaim supporting
at_least / at_most / between. All patterns route through
Verdict and tag failures with DetailKind::Temporal.
Structs§
- Better
Than Phase - Cross-phase “is the candidate phase better than the baseline phase on this
metric?” comparator, returned by
crate::vmm::VmResult::better_across_phases(pooled aggregate) andcrate::vmm::VmResult::better_across_phases_cgroup(one named cgroup). The polarity-aware sibling ofCrossPhaseRatio: it reads two PER-PHASE scalars (viaphase_metric/phase_cgroup_metric, not a sampled series) and orients “better” from the metric’s registry-declared polarity, so the same call expresses “scheduler beats EEVDF” for a LowerBetter latency AND a HigherBetter throughput without the test author naming a direction. A missing/undirected/zero-baseline comparison is Inconclusive (never a silent pass); a non-finite value is a Fail. - Claim
Better - Direct-claim “is this candidate better than this baseline on a
registered metric?” comparator, returned by
Verdict::claim_better. The polarity-aware sibling ofcrate::vmm::VmResult::better_across_phasesfor the case where the test already HOLDS two scalar values (not two phases): it orients “better” from the metric’s registry-declared polarity, so the SAME call expresses “candidate beats baseline” for a LowerBetter latency AND a HigherBetter throughput without the test author naming a direction. A metric with no lower/higher-better polarity (TargetValue/Unknown/Informational/ an unregistered or typo’d name) is INCONCLUSIVE (never a silent pass); a non-finite endpoint is aFail. - Cross
Phase Ratio - Cross-phase ratio builder returned by
SeriesField::ratio_across_phasesandPhaseMapExt::ratio_across_phases. Carries the resolved(earlier, later)values and a caller-supplied label so the terminal comparator chain (at_most) can format both values and the ratio into a single failure-or-note message. Mirrors theEachClaimshape (mutable verdict borrow held through the chain). - Each
Claim - Per-sample scalar claim builder returned by
SeriesField::each. Providesat_least/at_most/between— comparators that apply to every (successfully projected) sample independently. Per-sample errors from the projection (missing field, type mismatch) are routed through the verdict as failures so coverage gaps are never silent. - Series
Field - Per-sample column extracted from a
SampleSeries. Each slot is aSnapshotResult<T>so a missing or type-mismatched field does NOT abort the whole projection — it surfaces at the temporal-assertion site as a per-sample error the caller decides how to handle.
Traits§
- Frac
Pair - Per-phase “share of total” reducer. Specialized for the dominant
counter shape (
BTreeMap<Phase, u64>) becauseu64: Into<f64>is intentionally absent (cast is lossy) — a genericPhaseMapExtmethod with anInto<f64>bound would reject every counter-delta map test authors actually reach for. - Phase
MapExt - Extension trait that lets a pre-reduced per-phase map
(typically the output of
SeriesField::counter_delta_per_phase,SeriesField::last_per_phase, orSeriesField::first_per_phase) compose with the cross-phase comparator chainSeriesField::ratio_across_phasesexposes — without re-projecting the per-phase values back through a syntheticSeriesField.
Type Aliases§
- ByPhase
Partition - Return shape of
SeriesField::by_phase: aBTreeMapkeyed byPhasecarrying the samples whose source row had a stamped step_index, plus a separatenone_bucketfor unstamped / fixture samples. - Sample
Triple - Per-sample triple
(tag, elapsed_ms, &value)yielded bySeriesField::iter_fulland stored in the per-phase buckets returned bySeriesField::by_phase.