pub struct HealthTracker { /* private fields */ }Expand description
Module health tracker.
Implementations§
Source§impl HealthTracker
impl HealthTracker
Sourcepub fn new(module_name: String, config: HealthConfig) -> Self
pub fn new(module_name: String, config: HealthConfig) -> Self
Creates a new health tracker.
Sourcepub async fn record_success(&self, _latency_us: u64)
pub async fn record_success(&self, _latency_us: u64)
Records a successful health check.
Sourcepub async fn record_failure(&self, _error: Option<String>)
pub async fn record_failure(&self, _error: Option<String>)
Records a failed health check.
Sourcepub async fn status(&self) -> HealthStatus
pub async fn status(&self) -> HealthStatus
Returns the current health status.
Sourcepub async fn is_healthy(&self) -> bool
pub async fn is_healthy(&self) -> bool
Returns whether the module is healthy.
Sourcepub fn stats(&self) -> HealthStats
pub fn stats(&self) -> HealthStats
Returns statistics.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for HealthTracker
impl !RefUnwindSafe for HealthTracker
impl Send for HealthTracker
impl Sync for HealthTracker
impl Unpin for HealthTracker
impl UnsafeUnpin for HealthTracker
impl UnwindSafe for HealthTracker
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