pub struct SuccessRateOverTimeWindow<BACKOFF> { /* private fields */ }
Expand description
A policy based on an exponentially-weighted moving average success rate over a time window. A moving average is used so the success rate calculation is biased towards more recent requests.
Trait Implementations§
Source§impl<BACKOFF: Debug> Debug for SuccessRateOverTimeWindow<BACKOFF>
impl<BACKOFF: Debug> Debug for SuccessRateOverTimeWindow<BACKOFF>
Source§impl<BACKOFF> FailurePolicy for SuccessRateOverTimeWindow<BACKOFF>
impl<BACKOFF> FailurePolicy for SuccessRateOverTimeWindow<BACKOFF>
Source§fn record_success(&mut self)
fn record_success(&mut self)
Invoked when a request is successful.
Source§fn mark_dead_on_failure(&mut self) -> Option<Duration>
fn mark_dead_on_failure(&mut self) -> Option<Duration>
Invoked when a non-probing request fails. If it returns
Some(Duration)
,
the backend will mark as the dead for the specified Duration
.Auto Trait Implementations§
impl<BACKOFF> Freeze for SuccessRateOverTimeWindow<BACKOFF>where
BACKOFF: Freeze,
impl<BACKOFF> RefUnwindSafe for SuccessRateOverTimeWindow<BACKOFF>where
BACKOFF: RefUnwindSafe,
impl<BACKOFF> Send for SuccessRateOverTimeWindow<BACKOFF>where
BACKOFF: Send,
impl<BACKOFF> Sync for SuccessRateOverTimeWindow<BACKOFF>where
BACKOFF: Sync,
impl<BACKOFF> Unpin for SuccessRateOverTimeWindow<BACKOFF>where
BACKOFF: Unpin,
impl<BACKOFF> UnwindSafe for SuccessRateOverTimeWindow<BACKOFF>where
BACKOFF: UnwindSafe,
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