pub struct SpeedMeter { /* private fields */ }Expand description
Rolling-window throughput. PRD §17: downloaded / runtime is a bad speed
readout, because it cannot fall when the network stalls.
Implementations§
Source§impl SpeedMeter
impl SpeedMeter
pub fn new(window: Duration, start_bytes: u64) -> Self
pub fn record(&mut self, total_downloaded: u64)
Sourcepub fn rolling_bps(&self) -> f64
pub fn rolling_bps(&self) -> f64
Throughput over the rolling window.
Sourcepub fn smoothed_bps(&self) -> f64
pub fn smoothed_bps(&self) -> f64
Smoothed throughput — the right input for an ETA.
Sourcepub fn average_bps(&self, total_downloaded: u64) -> f64
pub fn average_bps(&self, total_downloaded: u64) -> f64
Whole-run average, for the completion summary only.
pub fn elapsed(&self) -> Duration
Auto Trait Implementations§
impl Freeze for SpeedMeter
impl RefUnwindSafe for SpeedMeter
impl Send for SpeedMeter
impl Sync for SpeedMeter
impl Unpin for SpeedMeter
impl UnsafeUnpin for SpeedMeter
impl UnwindSafe for SpeedMeter
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