Struct speedometer::Speedometer
[−]
[src]
pub struct Speedometer { pub window_size: Duration, // some fields omitted }
Measure speed in bytes/second.
Fields
window_size: Duration
Size of the window over which we measure entries.
Methods
impl Speedometer
[src]
pub fn new(window_size: Duration) -> Self
[src]
Create a new instance.
pub fn with_capacity(window_size: Duration, capacity: usize) -> Self
[src]
Create a new instance with a queue of capacity
.
pub fn with_queue(window_size: Duration, queue: VecDeque<Entry>) -> Self
[src]
Create a new instance with a new queue. Useful if you have prior knowledge of how big the allocation for the queue should be.
pub fn entry(&mut self, value: usize)
[src]
Enter a data point into the speedometer.
pub fn measure(&mut self) -> Result<usize, Error>
[src]
Measure the speed.
Trait Implementations
impl Debug for Speedometer
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more