Skip to main content

map_service_stats

Function map_service_stats 

Source
pub fn map_service_stats(
    output: &ListOutput,
    cgroup: &CgroupStats,
) -> ServiceStats
Expand description

Map a Unit.List reply onto ServiceStats.

The seven cgroup-derived fields come from cgroup (read from cgroupfs via crate::cgroup, #221) rather than the reply: Unit.List’s runtime.CGroup only carries values when the matching accounting option is on, while the files are always there when the controller is enabled. A cgroup field with no filesystem data falls back to the reply value, defaulting to UNSET when the reply omits it too.