pub struct HealthMonitor { /* private fields */ }Expand description
Health monitoring daemon with background thread.
Captures snapshots every 60 seconds and alerts on threshold violations. Thread-safe state access via RwLock.
Implementations§
Source§impl HealthMonitor
impl HealthMonitor
Sourcepub fn start() -> Result<Self, String>
pub fn start() -> Result<Self, String>
Starts the health monitoring background thread.
The monitor checks system health every 60 seconds and updates the shared health state. Alerts are generated for:
- Zombie count > 10
- CPU > 90% for 5+ consecutive minutes
- Monotonic RAM increase
§Returns
Ok(HealthMonitor) on success, or error if thread spawn fails.
Sourcepub fn health(&self) -> HealthState
pub fn health(&self) -> HealthState
Returns the current health state snapshot.
Sourcepub fn alerts(&self) -> Vec<HealthAlert>
pub fn alerts(&self) -> Vec<HealthAlert>
Returns recent health alerts (up to 100).
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Returns whether the monitor is still running.
Trait Implementations§
Source§impl Drop for HealthMonitor
impl Drop for HealthMonitor
Auto Trait Implementations§
impl Freeze for HealthMonitor
impl !RefUnwindSafe for HealthMonitor
impl Send for HealthMonitor
impl Sync for HealthMonitor
impl Unpin for HealthMonitor
impl UnsafeUnpin for HealthMonitor
impl !UnwindSafe for HealthMonitor
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
Mutably borrows from an owned value. Read more