pub struct PeerHealthTracker {
pub circuit_state: CircuitState,
pub consecutive_failures: u32,
pub consecutive_successes: u32,
pub last_failure_time: Option<SystemTime>,
pub circuit_opened_at: Option<SystemTime>,
pub total_failures: u64,
pub last_error: Option<SyncError>,
pub retry_attempt: u32,
}Expand description
Per-peer error tracking and health monitoring
Fields§
§circuit_state: CircuitStateCurrent circuit breaker state
consecutive_failures: u32Number of consecutive failures
consecutive_successes: u32Number of consecutive successes (for half-open state)
last_failure_time: Option<SystemTime>Timestamp of last failure
circuit_opened_at: Option<SystemTime>Timestamp when circuit was opened
total_failures: u64Total failure count (all time)
last_error: Option<SyncError>Last error encountered
retry_attempt: u32Current retry attempt
Implementations§
Source§impl PeerHealthTracker
impl PeerHealthTracker
Sourcepub fn record_success(&mut self)
pub fn record_success(&mut self)
Record a successful sync operation
Sourcepub fn record_failure(&mut self, error: SyncError)
pub fn record_failure(&mut self, error: SyncError)
Record a failed sync operation
Trait Implementations§
Source§impl Clone for PeerHealthTracker
impl Clone for PeerHealthTracker
Source§fn clone(&self) -> PeerHealthTracker
fn clone(&self) -> PeerHealthTracker
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 PeerHealthTracker
impl Debug for PeerHealthTracker
Source§impl Default for PeerHealthTracker
impl Default for PeerHealthTracker
Source§fn default() -> PeerHealthTracker
fn default() -> PeerHealthTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PeerHealthTracker
impl RefUnwindSafe for PeerHealthTracker
impl Send for PeerHealthTracker
impl Sync for PeerHealthTracker
impl Unpin for PeerHealthTracker
impl UnsafeUnpin for PeerHealthTracker
impl UnwindSafe for PeerHealthTracker
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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