pub struct CgroupStats {
pub cpu_usage_nsec: Option<u64>,
pub memory_current: Option<u64>,
pub memory_available: Option<u64>,
pub tasks_current: Option<u64>,
pub processes: u32,
pub io_read_bytes: Option<u64>,
pub io_read_operations: Option<u64>,
}Expand description
Accounting values for one service’s cgroup, read from cgroupfs.
None per field means “no data” (file absent or unparsable); callers map
that to u64::MAX, the [not set] sentinel D-Bus reports for the same
situation. processes counts instead of measuring, so it is 0 — not
None — when the cgroup is gone, matching GetProcesses on a dead unit.
Fields§
§cpu_usage_nsec: Option<u64>cpu.stat → usage_usec × 1000. No per-start baseline is subtracted:
D-Bus subtracts the counter value captured at unit start, which is
unknowable from the filesystem, so a reused cgroup reads marginally
higher. Fresh cgroups (the common case) match exactly.
memory_current: Option<u64>memory.current verbatim.
memory_available: Option<u64>min(memory.max, memory.high) − memory.current, minimized over the
unit’s ancestor slices; the root level always binds at host
MemAvailable. See the module docs for the full algorithm.
tasks_current: Option<u64>pids.current verbatim.
processes: u32Recursive cgroup.procs walk with the main and control PIDs folded in
the way systemd’s GetProcesses does (both can sit outside the
cgroup).
io_read_bytes: Option<u64>io.stat → rbytes summed over all devices. Some(0) when the file
exists but is empty (controller enabled, no IO yet — D-Bus reports 0
there too); None when the file is absent.
io_read_operations: Option<u64>io.stat → rios summed over all devices, same presence semantics.
Trait Implementations§
Source§impl Clone for CgroupStats
impl Clone for CgroupStats
Source§fn clone(&self) -> CgroupStats
fn clone(&self) -> CgroupStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CgroupStats
impl Debug for CgroupStats
Source§impl Default for CgroupStats
impl Default for CgroupStats
Source§fn default() -> CgroupStats
fn default() -> CgroupStats
impl Eq for CgroupStats
Source§impl PartialEq for CgroupStats
impl PartialEq for CgroupStats
Source§fn eq(&self, other: &CgroupStats) -> bool
fn eq(&self, other: &CgroupStats) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CgroupStats
Auto Trait Implementations§
impl Freeze for CgroupStats
impl RefUnwindSafe for CgroupStats
impl Send for CgroupStats
impl Sync for CgroupStats
impl Unpin for CgroupStats
impl UnsafeUnpin for CgroupStats
impl UnwindSafe for CgroupStats
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.