pub struct ReliabilityMonitor {
pub metrics_collector: MetricsCollector,
pub alert_manager: AlertManager,
pub health_reporter: HealthReporter,
pub stats: Arc<RwLock<MonitoringStats>>,
pub initialized: bool,
}Expand description
Reliability monitoring system
Fields§
§metrics_collector: MetricsCollectorMetrics collector
alert_manager: AlertManagerAlert manager
health_reporter: HealthReporterHealth reporter
stats: Arc<RwLock<MonitoringStats>>Monitoring statistics
initialized: boolWhether the system is initialized
Implementations§
Source§impl ReliabilityMonitor
impl ReliabilityMonitor
Sourcepub fn with_config(config: MonitorConfig) -> Self
pub fn with_config(config: MonitorConfig) -> Self
Create a new reliability monitor with configuration
Sourcepub async fn initialize(&mut self) -> Result<(), String>
pub async fn initialize(&mut self) -> Result<(), String>
Initialize the monitoring system
Sourcepub fn record_metric(&mut self, metric: Metric)
pub fn record_metric(&mut self, metric: Metric)
Record a metric
Sourcepub fn add_alert_rule(&mut self, rule: AlertRule)
pub fn add_alert_rule(&mut self, rule: AlertRule)
Add an alert rule
Sourcepub fn add_health_check(&mut self, health_check: HealthCheck)
pub fn add_health_check(&mut self, health_check: HealthCheck)
Add a health check
Sourcepub fn perform_health_checks(&mut self) -> Vec<HealthCheckResult>
pub fn perform_health_checks(&mut self) -> Vec<HealthCheckResult>
Perform all health checks
Sourcepub fn get_system_status(&mut self) -> SystemStatus
pub fn get_system_status(&mut self) -> SystemStatus
Get the current system status
Sourcepub async fn get_stats(&self) -> Result<MonitoringStats, String>
pub async fn get_stats(&self) -> Result<MonitoringStats, String>
Get monitoring statistics
Sourcepub fn get_alert_stats(&self) -> AlertStats
pub fn get_alert_stats(&self) -> AlertStats
Get alert statistics
Sourcepub fn get_health_stats(&self) -> HealthStats
pub fn get_health_stats(&self) -> HealthStats
Get health statistics
Sourcepub fn get_metrics(&self, name: &str, time_range: &TimeRange) -> Vec<&Metric>
pub fn get_metrics(&self, name: &str, time_range: &TimeRange) -> Vec<&Metric>
Get metrics for a specific name and time range
Sourcepub fn get_aggregated_metrics(
&self,
name: &str,
time_range: &TimeRange,
aggregation_type: AggregationType,
) -> Option<AggregatedMetric>
pub fn get_aggregated_metrics( &self, name: &str, time_range: &TimeRange, aggregation_type: AggregationType, ) -> Option<AggregatedMetric>
Get aggregated metrics
Sourcepub fn get_active_alerts(&self) -> Vec<&Alert>
pub fn get_active_alerts(&self) -> Vec<&Alert>
Get all active alerts
Sourcepub fn resolve_alert(&mut self, alert_id: &str) -> bool
pub fn resolve_alert(&mut self, alert_id: &str) -> bool
Resolve an alert
Sourcepub fn get_metric_names(&self) -> Vec<String>
pub fn get_metric_names(&self) -> Vec<String>
Get all metric names
Sourcepub fn clear_metrics(&mut self)
pub fn clear_metrics(&mut self)
Clear all metrics
Sourcepub fn clear_alert_history(&mut self)
pub fn clear_alert_history(&mut self)
Clear alert history
Trait Implementations§
Source§impl Clone for ReliabilityMonitor
impl Clone for ReliabilityMonitor
Source§fn clone(&self) -> ReliabilityMonitor
fn clone(&self) -> ReliabilityMonitor
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 ReliabilityMonitor
impl Debug for ReliabilityMonitor
Auto Trait Implementations§
impl Freeze for ReliabilityMonitor
impl !RefUnwindSafe for ReliabilityMonitor
impl Send for ReliabilityMonitor
impl Sync for ReliabilityMonitor
impl Unpin for ReliabilityMonitor
impl !UnwindSafe for ReliabilityMonitor
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