pub struct HealthMonitor { /* private fields */ }Expand description
Health monitor manager
Implementations§
Source§impl HealthMonitor
impl HealthMonitor
Sourcepub fn new(config: HealthMonitorConfig) -> Self
pub fn new(config: HealthMonitorConfig) -> Self
Create new health monitor
Sourcepub fn add_check(&mut self, check: HealthCheck)
pub fn add_check(&mut self, check: HealthCheck)
Add health check
Sourcepub fn remove_check(&mut self, name: &str)
pub fn remove_check(&mut self, name: &str)
Remove health check
Sourcepub async fn start_monitoring(&mut self) -> Result<(), HealthError>
pub async fn start_monitoring(&mut self) -> Result<(), HealthError>
Start health monitoring
Sourcepub fn get_service_health(&self) -> &ServiceHealth
pub fn get_service_health(&self) -> &ServiceHealth
Get current service health
Sourcepub fn get_system_metrics(&self) -> &SystemMetrics
pub fn get_system_metrics(&self) -> &SystemMetrics
Get current system metrics
Sourcepub fn get_check_results(&self) -> &HashMap<String, HealthCheckResult>
pub fn get_check_results(&self) -> &HashMap<String, HealthCheckResult>
Get health check results
Sourcepub fn get_check_result(&self, name: &str) -> Option<&HealthCheckResult>
pub fn get_check_result(&self, name: &str) -> Option<&HealthCheckResult>
Get specific health check result
Auto Trait Implementations§
impl Freeze for HealthMonitor
impl RefUnwindSafe for HealthMonitor
impl Send for HealthMonitor
impl Sync for HealthMonitor
impl Unpin for HealthMonitor
impl UnwindSafe for HealthMonitor
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