Skip to main content

StatusSnapshotV2

Struct StatusSnapshotV2 

Source
pub struct StatusSnapshotV2 {
    pub schema_version: u16,
    pub observed_at_unix_ms: u64,
    pub sample_interval_ms: u64,
    pub capabilities: MetricCapabilitiesV2,
    pub system: SystemIdentity,
    pub cpu: CpuMetricsV2,
    pub load: Option<LoadAverage>,
    pub memory: MemoryMetrics,
    pub swap: Option<SwapMetrics>,
    pub commit: Option<CommitMetrics>,
}
Expand description

Top-level daemon snapshot for schema version 2.

V2 extends v1 by making load, swap, and commit optional with explicit capability flags. Platforms that do not support a metric report false for the capability and None for the value.

Fields§

§schema_version: u16

Schema major version. Must equal SCHEMA_VERSION_V2.

§observed_at_unix_ms: u64

Unix epoch in milliseconds at which the snapshot was produced.

§sample_interval_ms: u64

Sampling cadence in milliseconds used to derive percentage metrics.

§capabilities: MetricCapabilitiesV2

Per-metric capability flags for v2.

§system: SystemIdentity

Stable identity fields.

§cpu: CpuMetricsV2

CPU utilization.

§load: Option<LoadAverage>

Load averages. None when capabilities.load_average is false.

§memory: MemoryMetrics

Physical memory utilization.

§swap: Option<SwapMetrics>

Swap utilization. None when capabilities.swap is false.

§commit: Option<CommitMetrics>

Windows commit charge (or similar commit accounting). None when capabilities.memory_commit is false.

Implementations§

Source§

impl StatusSnapshotV2

Source

pub fn validate(&self) -> Result<(), Vec<ValidationViolationV2>>

Validate that every field satisfies the version-2 protocol invariants.

Returns Ok(()) or a list of structured violations. Each violation carries a field path and a crate::ViolationKindV2.

Trait Implementations§

Source§

impl Clone for StatusSnapshotV2

Source§

fn clone(&self) -> StatusSnapshotV2

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 StatusSnapshotV2

Source§

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

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

impl<'de> Deserialize<'de> for StatusSnapshotV2

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 StatusSnapshotV2

Source§

fn eq(&self, other: &StatusSnapshotV2) -> 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 StatusSnapshotV2

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 StatusSnapshotV2

Auto Trait Implementations§

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.