populate_run_ext_all

Function populate_run_ext_all 

Source
pub fn populate_run_ext_all(stats: &mut ScenarioStats, samples: &SampleSeries)
Expand description

Run the FULL run-level ext_metrics population sequence into stats — the single source of truth shared by the eval layer (evaluate_vm_result) and crate::vmm::VmResult::run_metric, so the two produce byte-identical run-level ext maps for the same run. Reads samples + stats.phases + stats.cgroups, writes stats.ext_metrics, in the canonical order:

  1. derive_phase_metrics — derive per-cgroup and pooled phase scalars, including the CPU-denominated iteration_rate components.
  2. populate_run_ext_metrics — the read_sample-wired registry family (over every freeze in samples), then the whole-run wall + IRQ rates.
  3. populate_run_ext_metrics_from_phases — the phase-only ext metrics whose read_sample is None (avg_imbalance_ratio, iteration_rate, system_time_ns, user_time_ns, the per-CPU IRQ spatial maxes, and the per-cgroup PSI-irq spatial maxes).
  4. populate_run_pooled_iteration_rate — add any whole-run cgroup carriers to the canonical iteration_rate pool.
  5. populate_run_pooled_taobench — the whole-run taobench throughput + hit Rates pooled cross-cgroup (from stats.cgroups[].taobench_whole).
  6. populate_run_pooled_taobench_distribution — the taobench whole-run open-loop serve-latency *_whole percentiles (union of the per-phase per-cgroup serve PlatStats histograms, percentile re-derived over the union).
  7. populate_run_pooled_schbench — the schbench whole-run loop Counter + role-separate run-delay gate-Rates (from stats.phases[].per_cgroup[].schbench raw pairs, summed over phases+cgroups).
  8. populate_run_pooled_schbench_distribution — the schbench whole-run latency/rps *_whole percentiles (union of the per-phase per-cgroup PlatStats histograms, percentile re-derived over the union).
  9. populate_run_distribution_metrics — the Distribution / WorstLowest / WakeLatencyTailRatio / WorstCrossNodeRatio re-pools (from stats.phases[].per_cgroup raw samples + stats.cgroups).

ORDER IS LOAD-BEARING: step 1 must precede step 3 so the canonical CPU-denominated phase rate exists before the run fold. Step 2 must also precede step 3 so whole-run IRQ-counter deltas land before step 3’s contains_key skip; steps 4-9 fold the per-cgroup roll-up after the per-phase families.

stats.phases may be pre- or post-derived. Step 1 is idempotent and deliberately owns this derivation so callers cannot accidentally omit the guest CPU-time components required by iteration_rate.