Struct sim::analytics::SlidingWindow [−][src]
A sliding window, used to count something over time
Fields
times: VecDeque<Time>
window_size: Duration
Implementations
impl SlidingWindow
[src]
impl SlidingWindow
[src]pub fn new(window_size: Duration) -> SlidingWindow
[src]
pub fn add(&mut self, time: Time) -> usize
[src]
Returns the count at time
pub fn count(&mut self, end: Time) -> usize
[src]
Grab the count at this time, but don’t add a new time
pub fn close_off_pts(&mut self, pts: &mut Vec<(Time, usize)>, end_time: Time)
[src]
Ensure the points cover up to end_time
. The last event may occur before then, and it’s
necessary to draw more points to show the count drop off.
Auto Trait Implementations
impl RefUnwindSafe for SlidingWindow
impl Send for SlidingWindow
impl Sync for SlidingWindow
impl Unpin for SlidingWindow
impl UnwindSafe for SlidingWindow
Blanket Implementations
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,