pub struct EMAWindow { /* private fields */ }Expand description
A time window for tracking failures with exponential moving average.
Implementations§
Source§impl EMAWindow
impl EMAWindow
Sourcepub fn record_success(&self)
pub fn record_success(&self)
Records a successful call.
Sourcepub fn record_failure(&self)
pub fn record_failure(&self)
Records a failed call.
Sourcepub fn error_rate(&self) -> f64
pub fn error_rate(&self) -> f64
Gets the current EMA error rate.
Auto Trait Implementations§
impl !Freeze for EMAWindow
impl RefUnwindSafe for EMAWindow
impl Send for EMAWindow
impl Sync for EMAWindow
impl Unpin for EMAWindow
impl UnwindSafe for EMAWindow
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