pub struct AlertManager { /* private fields */ }Expand description
Alert manager for handling alert rules and notifications
Implementations§
Source§impl AlertManager
impl AlertManager
Sourcepub fn with_config(config: AlertConfig) -> Self
pub fn with_config(config: AlertConfig) -> Self
Create an alert manager with configuration
Sourcepub fn remove_rule(&mut self, rule_id: &str)
pub fn remove_rule(&mut self, rule_id: &str)
Remove an alert rule
Sourcepub fn update_rule(&mut self, rule: AlertRule)
pub fn update_rule(&mut self, rule: AlertRule)
Update an alert rule
Sourcepub fn check_metric(&mut self, metric_name: &str, value: f64) -> Vec<Alert>
pub fn check_metric(&mut self, metric_name: &str, value: f64) -> Vec<Alert>
Check if a metric value should trigger an alert
Sourcepub fn get_active_alerts(&self) -> Vec<&Alert>
pub fn get_active_alerts(&self) -> Vec<&Alert>
Get all active alerts
Sourcepub fn get_alerts_by_severity(&self, severity: &AlertSeverity) -> Vec<&Alert>
pub fn get_alerts_by_severity(&self, severity: &AlertSeverity) -> Vec<&Alert>
Get alerts by severity
Sourcepub fn resolve_alert(&mut self, alert_id: &str) -> bool
pub fn resolve_alert(&mut self, alert_id: &str) -> bool
Resolve an alert by ID
Sourcepub fn clear_history(&mut self)
pub fn clear_history(&mut self)
Clear alert history
Sourcepub fn get_stats(&self) -> AlertStats
pub fn get_stats(&self) -> AlertStats
Get alert statistics
Trait Implementations§
Source§impl Clone for AlertManager
impl Clone for AlertManager
Source§fn clone(&self) -> AlertManager
fn clone(&self) -> AlertManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AlertManager
impl Debug for AlertManager
Auto Trait Implementations§
impl Freeze for AlertManager
impl RefUnwindSafe for AlertManager
impl Send for AlertManager
impl Sync for AlertManager
impl Unpin for AlertManager
impl UnwindSafe for AlertManager
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