#[non_exhaustive]pub struct CgroupCpuStats {
pub usage_usec: u64,
pub nr_throttled: u64,
pub throttled_usec: u64,
pub max_quota_us: Option<u64>,
pub max_period_us: u64,
pub weight: Option<u64>,
pub weight_nice: Option<i32>,
}Expand description
CPU controller state for one cgroup. Fields mirror the
cpu.* cgroup v2 files exposed under
<cgroup>/cpu.stat, <cgroup>/cpu.max,
<cgroup>/cpu.weight, and <cgroup>/cpu.weight.nice.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.usage_usec: u64usage_usec from cpu.stat. Cumulative CPU time consumed
by tasks in this cgroup, in microseconds.
nr_throttled: u64nr_throttled from cpu.stat. Cumulative count of
CFS-bandwidth throttling events that paused this cgroup.
throttled_usec: u64throttled_usec from cpu.stat. Cumulative wall-clock
time the cgroup spent throttled by CFS bandwidth.
max_quota_us: Option<u64>cpu.max quota in microseconds. None when the file is
absent (root cgroup) OR when the kernel emits the literal
“max” token (no CFS bandwidth cap configured for this
cgroup).
max_period_us: u64cpu.max period in microseconds. Default 100_000 (100ms)
per the kernel default. Always present alongside the
quota half on a child cgroup; defaults to 100_000 when
the file is absent (root cgroup).
weight: Option<u64>cpu.weight (1..=10_000, default 100). None when the
file is absent (root cgroup); the kernel does not allow
0 as a value, so the absent-vs-zero distinction is
load-bearing.
weight_nice: Option<i32>cpu.weight.nice (-20..=19, default 0). None when the
file is absent. Alias-domain for Self::weight —
the kernel writes both files in lockstep but they’re
captured independently to surface any
kernel-version-specific divergence.
Trait Implementations§
Source§impl Clone for CgroupCpuStats
impl Clone for CgroupCpuStats
Source§fn clone(&self) -> CgroupCpuStats
fn clone(&self) -> CgroupCpuStats
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CgroupCpuStats
impl Debug for CgroupCpuStats
Source§impl Default for CgroupCpuStats
impl Default for CgroupCpuStats
Source§fn default() -> CgroupCpuStats
fn default() -> CgroupCpuStats
Source§impl<'de> Deserialize<'de> for CgroupCpuStats
impl<'de> Deserialize<'de> for CgroupCpuStats
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for CgroupCpuStats
impl RefUnwindSafe for CgroupCpuStats
impl Send for CgroupCpuStats
impl Sync for CgroupCpuStats
impl Unpin for CgroupCpuStats
impl UnwindSafe for CgroupCpuStats
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more