pub struct RateMeter { /* private fields */ }Expand description
Exponentially weighted moving average of a byte counter’s rate.
Time-based: the weight of each sample depends on how much wall clock it covers, not on how many samples were taken, so the smoothing has the same time constant at 50 Hz and at one sample a second. The estimate starts at zero and is driven by the samples alone; the first call only records where the counter stood.
Implementations§
Source§impl RateMeter
impl RateMeter
Sourcepub const ETA_FLOOR: f64 = 1024.0
pub const ETA_FLOOR: f64 = 1024.0
Below this the rate is startup noise and an ETA built from it counts
down from nonsense; eta_secs reports none instead.
Sourcepub fn new(tau_secs: f64) -> Self
pub fn new(tau_secs: f64) -> Self
A meter that forgets about 63% of the past every tau_secs seconds.
Trait Implementations§
impl StructuralPartialEq for RateMeter
Auto Trait Implementations§
impl Freeze for RateMeter
impl RefUnwindSafe for RateMeter
impl Send for RateMeter
impl Sync for RateMeter
impl Unpin for RateMeter
impl UnsafeUnpin for RateMeter
impl UnwindSafe for RateMeter
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