pub struct TrackerEntry {
pub url: String,
pub last_success: Option<Instant>,
pub last_failure: Option<Instant>,
pub failure_count: u32,
pub success_count: u32,
pub avg_response_ms: f64,
pub next_retry_after: Option<Instant>,
}Expand description
A single tracker entry with health tracking
Fields§
§url: String§last_success: Option<Instant>§last_failure: Option<Instant>§failure_count: u32§success_count: u32§avg_response_ms: f64§next_retry_after: Option<Instant>Implementations§
Source§impl TrackerEntry
impl TrackerEntry
Sourcepub fn reliability_score(&self) -> f64
pub fn reliability_score(&self) -> f64
Reliability score 0.0..1.0 based on success/failure ratio weighted by recency
Sourcepub fn record_success(&mut self, latency_ms: f64)
pub fn record_success(&mut self, latency_ms: f64)
Record a successful response with latency measurement
Sourcepub fn record_failure(&mut self)
pub fn record_failure(&mut self)
Record a failed response and schedule backoff
Sourcepub fn schedule_backoff(&mut self, base_secs: u64)
pub fn schedule_backoff(&mut self, base_secs: u64)
Exponential backoff: min(base * 2^failures, 3600s)
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Check if this tracker is available for retry
Trait Implementations§
Source§impl Clone for TrackerEntry
impl Clone for TrackerEntry
Source§fn clone(&self) -> TrackerEntry
fn clone(&self) -> TrackerEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TrackerEntry
impl RefUnwindSafe for TrackerEntry
impl Send for TrackerEntry
impl Sync for TrackerEntry
impl Unpin for TrackerEntry
impl UnsafeUnpin for TrackerEntry
impl UnwindSafe for TrackerEntry
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