pub struct StreamAnalytics { /* private fields */ }Expand description
Stream analytics helper for complex aggregations
Implementations§
Source§impl StreamAnalytics
impl StreamAnalytics
Sourcepub fn aggregate_cached(
&mut self,
key: &str,
window: &TimeWindow,
aggregator: &Aggregator,
current_time: u64,
) -> AggregationResult
pub fn aggregate_cached( &mut self, key: &str, window: &TimeWindow, aggregator: &Aggregator, current_time: u64, ) -> AggregationResult
Perform cached aggregation
Sourcepub fn moving_average(
&self,
windows: &[TimeWindow],
field: &str,
window_count: usize,
) -> Option<f64>
pub fn moving_average( &self, windows: &[TimeWindow], field: &str, window_count: usize, ) -> Option<f64>
Calculate moving average over multiple windows
Sourcepub fn detect_anomalies(
&self,
windows: &[TimeWindow],
field: &str,
threshold: f64,
) -> Vec<String>
pub fn detect_anomalies( &self, windows: &[TimeWindow], field: &str, threshold: f64, ) -> Vec<String>
Detect anomalies using z-score
Sourcepub fn calculate_trend(
&self,
windows: &[TimeWindow],
field: &str,
) -> TrendDirection
pub fn calculate_trend( &self, windows: &[TimeWindow], field: &str, ) -> TrendDirection
Calculate trend direction
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StreamAnalytics
impl RefUnwindSafe for StreamAnalytics
impl Send for StreamAnalytics
impl Sync for StreamAnalytics
impl Unpin for StreamAnalytics
impl UnwindSafe for StreamAnalytics
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