pub struct RollingRate { /* private fields */ }Expand description
Rolling-window rate tracker.
The producer records completion counts (typically 1 per ItemIndexed
/ ItemSkipped / ItemFailed) and queries Self::rate_per_sec
or Self::eta_secs when emitting a IndexEvent::StatsTick. The
window is purely time-based: samples older than window_size are
evicted on every observation.
Implementations§
Source§impl RollingRate
impl RollingRate
Sourcepub fn rate_per_sec(&self) -> f64
pub fn rate_per_sec(&self) -> f64
Current rate in items/sec over the rolling window.
Returns 0.0 if there is fewer than two observations or the window spans less than 1ms (avoids division-by-near-zero blow-ups).
Trait Implementations§
Source§impl Clone for RollingRate
impl Clone for RollingRate
Source§fn clone(&self) -> RollingRate
fn clone(&self) -> RollingRate
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 RollingRate
impl RefUnwindSafe for RollingRate
impl Send for RollingRate
impl Sync for RollingRate
impl Unpin for RollingRate
impl UnsafeUnpin for RollingRate
impl UnwindSafe for RollingRate
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