Skip to main content

core_util_quartiles

Function core_util_quartiles 

Source
pub fn core_util_quartiles(
    prev: &[CpuTicks],
    cur: &[CpuTicks],
) -> Option<(f64, f64, f64, usize)>
Expand description

Per-core utilization quartiles between two snapshots: (p25, p50, p75, cores). Same shared-prefix rule as max_core_util.

The per-core vector is already built to find the max; the quartiles are a sort of that same vector, so the shape costs one sort per sample window and no extra reads of /proc/stat.

Nearest-rank on the sorted ascending vector (no interpolation): the quantile of a core count is a real core’s utilization, which is the honest reading when the population is small — an interpolated “p75” across 4 cores would name a utilization no core actually had.