pub struct ReplicaHealth {
pub id: String,
pub status: HealthStatus,
pub lag: Option<Duration>,
pub last_check: Option<Instant>,
pub latency: Option<Duration>,
pub consecutive_failures: u32,
}Expand description
Health information for a replica.
Fields§
§id: StringReplica ID.
status: HealthStatusCurrent health status.
lag: Option<Duration>Current replication lag (if known).
last_check: Option<Instant>Last successful health check.
latency: Option<Duration>Response latency.
consecutive_failures: u32Consecutive failures.
Implementations§
Source§impl ReplicaHealth
impl ReplicaHealth
Sourcepub fn mark_healthy(&mut self, latency: Duration, lag: Option<Duration>)
pub fn mark_healthy(&mut self, latency: Duration, lag: Option<Duration>)
Mark as healthy.
Sourcepub fn mark_degraded(&mut self, reason: &str)
pub fn mark_degraded(&mut self, reason: &str)
Mark as degraded.
Sourcepub fn mark_unhealthy(&mut self)
pub fn mark_unhealthy(&mut self)
Mark as unhealthy.
Trait Implementations§
Source§impl Clone for ReplicaHealth
impl Clone for ReplicaHealth
Source§fn clone(&self) -> ReplicaHealth
fn clone(&self) -> ReplicaHealth
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 moreAuto Trait Implementations§
impl Freeze for ReplicaHealth
impl RefUnwindSafe for ReplicaHealth
impl Send for ReplicaHealth
impl Sync for ReplicaHealth
impl Unpin for ReplicaHealth
impl UnwindSafe for ReplicaHealth
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