pub fn populate_run_pooled_schbench(stats: &mut ScenarioStats)Expand description
Inject the schbench whole-run Class-3 metrics — the loop Counter and the
role-separate run-delay gate-Rate components — into stats.ext_metrics,
summed across EVERY phase and EVERY cgroup from the per-phase
SchbenchPhaseStats raw pairs (stats.phases[].per_cgroup[].schbench). The
raw (run_delay_ns, pcount) pairs and loop_count are integer and
associative, so summing across phases+cgroups gives the run-level totals; the
two *_run_delay_ns_per_sched Rates then re-derive Σrun_delay/Σpcount (the
sample-weighted per-schedule mean — NOT a mean of per-run means). The MESSAGE
and WORKER thread roles pool SEPARATELY (different per-schedule wait
populations — never cross-pool).
Runs in populate_run_ext_all (post-merge, after
populate_run_pooled_taobench); reads the per-phase carriers (a disjoint
source from the iterations/taobench pools) and writes distinct
total_schbench_* / schbench_*_run_delay_ns_per_sched keys, so it is
order-independent. A run with no schbench carrier writes nothing (keys stay
absent — a non-schbench run is distinct from a measured zero).
Both-or-neither PER ROLE: each role’s two Counter components are inserted only
when that role was scheduled (pcount > 0), so derive_rate_metrics yields
the role’s gate-Rate iff it ran (never a 0/0); the two roles are independent
(a worker-only run emits only the worker Rate). total_schbench_loops is
always written when any schbench carrier ran (0 is a measured zero). The
per-phase sched_delay_msg/worker_us is the SAME Σrun_delay_ns/Σpcount
per-schedule mean at phase scope (NOT schbench’s native mean-of-per-thread-
means, a separate whole-run SchbenchResult stat) and stays PerPhase
display-only — only these Rates gate; no double-count. Cross-RUN the
components SUM-fold (Counter), so each Rate re-pools Σrun_delay/Σpcount.