pub struct MonitoringSystem { /* private fields */ }
Expand description
Monitoring system manager
Implementations§
Source§impl MonitoringSystem
impl MonitoringSystem
Sourcepub fn new(config: MonitoringConfig) -> Self
pub fn new(config: MonitoringConfig) -> Self
Create new monitoring system
Sourcepub async fn initialize(&mut self) -> Result<(), MonitoringError>
pub async fn initialize(&mut self) -> Result<(), MonitoringError>
Initialize monitoring system
Sourcepub fn register_metric(&mut self, metric: Metric)
pub fn register_metric(&mut self, metric: Metric)
Register a new metric
Sourcepub fn record_metric(
&mut self,
name: &str,
value: f64,
labels: HashMap<String, String>,
) -> Result<(), MonitoringError>
pub fn record_metric( &mut self, name: &str, value: f64, labels: HashMap<String, String>, ) -> Result<(), MonitoringError>
Record metric value
Sourcepub fn add_alert_rule(&mut self, rule: AlertRule)
pub fn add_alert_rule(&mut self, rule: AlertRule)
Add alert rule
Sourcepub async fn evaluate_alerts(&mut self) -> Result<(), MonitoringError>
pub async fn evaluate_alerts(&mut self) -> Result<(), MonitoringError>
Evaluate alert rules
Sourcepub fn export_prometheus_metrics(&self) -> String
pub fn export_prometheus_metrics(&self) -> String
Export metrics in Prometheus format
Sourcepub fn get_metrics(&self) -> &HashMap<String, Metric>
pub fn get_metrics(&self) -> &HashMap<String, Metric>
Get current metrics
Sourcepub fn get_active_alerts(&self) -> &Vec<Alert>
pub fn get_active_alerts(&self) -> &Vec<Alert>
Get active alerts
Sourcepub fn get_dashboards(&self) -> &Vec<Dashboard>
pub fn get_dashboards(&self) -> &Vec<Dashboard>
Get dashboards
Auto Trait Implementations§
impl Freeze for MonitoringSystem
impl RefUnwindSafe for MonitoringSystem
impl Send for MonitoringSystem
impl Sync for MonitoringSystem
impl Unpin for MonitoringSystem
impl UnwindSafe for MonitoringSystem
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more