Skip to main content

LimitStatus

Struct LimitStatus 

Source
pub struct LimitStatus {
Show 22 fields pub id: String, pub kind: LimitKind, pub label: String, pub runtime: Option<String>, pub sandbox_id: Option<String>, pub cgroup: Option<String>, pub pod: Option<String>, pub usage: Measured<u64>, pub limit: Measured<u64>, pub target: LimitTarget, pub high: Option<u64>, pub peak: Measured<u64>, pub pct: Option<f64>, pub growth_per_min: Measured<f64>, pub forecast: Option<LimitForecast>, pub state: LimitState, pub oom_kills: Measured<u64>, pub oom_kills_observed: u64, pub last_oom_kill_ms: Option<u64>, pub oom_killed_last_exit: Option<bool>, pub restarts: Option<u32>, pub summary: String,
}
Expand description

One limit and how close it is (SPEC §8.3). summary is in IEC units; LimitStatus::sentence re-renders it in the caller’s units.

Fields§

§id: String

Stable id: cgroup:<path>, a sandbox id (docker:<12 hex>), k8s:<ns>/<pod>/<container>.

§kind: LimitKind§label: String

Container / pod / unit name.

§runtime: Option<String>

Engine or cluster runtime (“docker”, “orbstack”, “kubernetes”, “systemd”).

§sandbox_id: Option<String>

crate::model::Sandbox::id of the container or VM, when there is one.

§cgroup: Option<String>

cgroup path, when the numbers come from cgroup files.

§pod: Option<String>

namespace/pod for Kubernetes containers and pods.

§usage: Measured<u64>

Working set (see module docs).

§limit: Measured<u64>

The limit the percent and forecast use (memory.max, else memory.high; engine limit; VM size).

§target: LimitTarget§high: Option<u64>

memory.high when set below memory.max.

§peak: Measured<u64>

Highest usage the kernel recorded (memory.peak), when readable.

§pct: Option<f64>

usage ÷ limit × 100.

§growth_per_min: Measured<f64>

Growth over the last ≤ 5 min (bytes/min, an estimate; may be noise — the forecast is the trustworthy signal).

§forecast: Option<LimitForecast>§state: LimitState§oom_kills: Measured<u64>

Kernel OOM kills inside the cgroup since it was created (memory.events:oom_kill).

§oom_kills_observed: u64

OOM kills that happened while oomtop was watching.

§last_oom_kill_ms: Option<u64>

When the newest observed OOM kill was noticed (ms since the epoch).

§oom_killed_last_exit: Option<bool>

The container’s previous run ended in an OOM kill (Docker State.OOMKilled, Kubernetes lastState.terminated.reason = OOMKilled).

§restarts: Option<u32>

Restarts (Docker RestartCount, Kubernetes restartCount).

§summary: String

“container web hits its 2.0 GiB limit in ~4 min” (IEC units).

Implementations§

Source§

impl LimitStatus

Source

pub fn sentence(&self, units: UnitSystem, decimals: usize) -> String

The one-line answer in the caller’s units.

Trait Implementations§

Source§

impl Clone for LimitStatus

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LimitStatus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LimitStatus

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for LimitStatus

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for LimitStatus

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for LimitStatus

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for LimitStatus

Auto Trait Implementations§

§

impl Forget for LimitStatus

§

impl Freeze for LimitStatus
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, &'static str: Freeze, String: Freeze,

§

impl Move for LimitStatus

§

impl RefUnwindSafe for LimitStatus

§

impl Send for LimitStatus
where RawVecInner: Send, &'static str: Send, String: Send,

§

impl Sync for LimitStatus
where RawVecInner: Sync, String: Sync,

§

impl Unpin for LimitStatus
where *const u8 is !null: Unpin, &'static str: Unpin, String: Unpin,

§

impl UnsafeUnpin for LimitStatus

§

impl UnwindSafe for LimitStatus
where RawVecInner: UnwindSafe, &'static str: UnwindSafe, String: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.