SystemHealth

Struct SystemHealth 

Source
#[repr(align(64))]
pub struct SystemHealth { /* private fields */ }
Expand description

System health monitor with process introspection

Tracks both system-wide and process-specific resource usage. Cache-line aligned for maximum performance.

Implementations§

Source§

impl SystemHealth

Source

pub fn new() -> Self

Create new system health monitor

Source

pub fn with_interval(interval: Duration) -> Self

Create with custom update interval

Source

pub fn cpu_used(&self) -> f64

Get system CPU usage percentage - SIMPLE AF API

Source

pub fn cpu_free(&self) -> f64

Get system CPU free percentage

Source

pub fn mem_used_mb(&self) -> f64

Get system memory usage in MB

Source

pub fn mem_used_gb(&self) -> f64

Get system memory usage in GB

Source

pub fn process_cpu_used(&self) -> f64

Get process CPU usage percentage

Source

pub fn process_mem_used_mb(&self) -> f64

Get process memory usage in MB

Source

pub fn load_avg(&self) -> f64

Get system load average

Source

pub fn thread_count(&self) -> u32

Get process thread count

Source

pub fn fd_count(&self) -> u32

Get process file descriptor count

Source

pub fn health_score(&self) -> f64

Get overall system health score (0.0-100.0)

Source

pub fn quick_check(&self) -> HealthStatus

Quick health check - sub-microsecond if cached

Source

pub fn update(&self)

Force immediate update of all metrics

Source

pub fn snapshot(&self) -> SystemSnapshot

Get detailed system snapshot

Source

pub fn process(&self) -> ProcessStats

Get process-specific statistics

Trait Implementations§

Source§

impl Debug for SystemHealth

Source§

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

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

impl Default for SystemHealth

Source§

fn default() -> Self

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

impl Display for SystemHealth

Source§

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

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

impl Send for SystemHealth

Source§

impl Sync for SystemHealth

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.