populate_run_ext_metrics

Function populate_run_ext_metrics 

Source
pub fn populate_run_ext_metrics(
    samples: &SampleSeries,
    target: &mut BTreeMap<String, f64>,
)
Expand description

Populate cross-RUN aggregate entries for every registered crate::stats::MetricDef whose read_sample returns finite values across the entire sample series. Writes into target (typically ScenarioStats::ext_metrics) under the metric’s registry name — the same key the per-phase PhaseBucket::metrics uses, so cross-RUN and per-phase consumers reference the same name.

Existing keys are NOT overwritten — a typed GauntletRow field’s value (populated via the MetricDef accessor at sidecar-write time) wins on the read path, and this fn fills the gap for registered metrics that have a read_sample wire but no typed GauntletRow field. Without this fill, cargo ktstr perf-delta silently skips the metric (read returns None on both sides, so the (None, None) arm drops the pair).

Per-phase reduction dispatch is described on PhaseBucket; the cross-RUN fold here uses crate::stats::aggregate_samples_for_phase over the full sample series, with TYPED_FIELD_NAMES gating to avoid duplicating typed-accessor sources.