Struct windowed_stats::TimeSeries
source · pub struct TimeSeries<T> { /* private fields */ }
Implementations§
source§impl<T: Default> TimeSeries<T>
impl<T: Default> TimeSeries<T>
pub fn new( create_aggregation_fn: impl Fn() -> Box<dyn Fn(&T, &T) -> T + Send>, ) -> Self
pub fn with_n_windows( minutely_windows: MinutelyWindows, fifteen_minutely_windows: FifteenMinutelyWindows, hourly_windows: HourlyWindows, create_aggregation_fn: impl Fn() -> Box<dyn Fn(&T, &T) -> T + Send>, ) -> Self
sourcepub fn update_windows(&mut self)
pub fn update_windows(&mut self)
Check whether the current time has exceeded the bound of the existing windows. If yes then slide windows as many times as required until the window encompasses the current time.
sourcepub fn log_value(&mut self, item: &T)
pub fn log_value(&mut self, item: &T)
Log the value into TimeSeries
. This operation automatically updates the windows.
sourcepub fn minutely_iter<'a>(&'a self) -> impl ExactSizeIterator<Item = &'a T>
pub fn minutely_iter<'a>(&'a self) -> impl ExactSizeIterator<Item = &'a T>
Get Iterator to traverse the minutely windows
sourcepub fn get_aggregated_value(&mut self) -> T
pub fn get_aggregated_value(&mut self) -> T
Get the aggregated value of the data that are still kept
pub fn record_schema(&mut self, node: &InspectNode)
source§impl<T: Into<u64> + Clone + Default> TimeSeries<T>
impl<T: Into<u64> + Clone + Default> TimeSeries<T>
pub fn log_inspect_uint_array( &mut self, node: &InspectNode, child_name: &'static str, )
source§impl<T: Into<i64> + Clone + Default> TimeSeries<T>
impl<T: Into<i64> + Clone + Default> TimeSeries<T>
pub fn log_inspect_int_array( &mut self, node: &InspectNode, child_name: &'static str, )
source§impl TimeSeries<SumAndCount>
impl TimeSeries<SumAndCount>
pub fn log_avg_inspect_double_array( &mut self, node: &InspectNode, child_name: &'static str, )
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for TimeSeries<T>
impl<T> !RefUnwindSafe for TimeSeries<T>
impl<T> Send for TimeSeries<T>where
T: Send,
impl<T> !Sync for TimeSeries<T>
impl<T> Unpin for TimeSeries<T>where
T: Unpin,
impl<T> !UnwindSafe for TimeSeries<T>
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