cgroup_cell

Function cgroup_cell 

Source
pub fn cgroup_cell(
    baseline: Option<u64>,
    candidate: Option<u64>,
    ladder: ScaleLadder,
) -> String
Expand description

Render a (baseline, candidate, delta) cell for the cgroup-enrichment secondary table emitted under super::GroupBy::Cgroup. The ladder parameter routes each scalar through auto_scale (private to this module) so a 7.5 GiB memory_current row reads 7.500GiB → 8.250GiB (+768.000MiB) instead of 8053063680 → 8858370048 (+805306368). Each cell scales independently — baseline, candidate, and delta may pick different prefixes when their magnitudes cross thresholds.

See ScaleLadder for the closed enumeration of supported ladder families and per-variant step-up rules. The variants most relevant to cgroup-render call sites:

  • ScaleLadder::Us: cgroup cpu_usage_usec / throttled_usec / PSI total_usec.
  • ScaleLadder::Bytes: memory_current / memory.max / memory.high (IEC binary, B → KiB → MiB → GiB → TiB).
  • ScaleLadder::Unitless: nr_throttled / cpu.weight / pids.current / sched_ext attribute counters (decimal SI, “” → K → M → G).