pub struct WindowedAggregation { /* private fields */ }Expand description
Main windowed aggregation processor.
Implementations§
Source§impl WindowedAggregation
impl WindowedAggregation
Sourcepub fn new(config: WindowConfig) -> Self
pub fn new(config: WindowConfig) -> Self
Create a new processor with the given configuration.
Sourcepub fn process_tumbling(&self, events: &[(u64, f64)]) -> Vec<WindowResult>
pub fn process_tumbling(&self, events: &[(u64, f64)]) -> Vec<WindowResult>
Process a sequence of (timestamp_ms, value) pairs using tumbling windows.
Each event is assigned to exactly one window [start, start + size_ms).
Sourcepub fn process_sliding(&self, events: &[(u64, f64)]) -> Vec<WindowResult>
pub fn process_sliding(&self, events: &[(u64, f64)]) -> Vec<WindowResult>
Process a sequence of (timestamp_ms, value) pairs using sliding windows.
Windows overlap: each window advances by step_ms and spans size_ms.
Sourcepub fn process_count(&self, values: &[f64]) -> Vec<WindowResult>
pub fn process_count(&self, values: &[f64]) -> Vec<WindowResult>
Process a flat slice of values using count-based windows.
Window i covers values[i*step .. i*step+size].
Sourcepub fn process_session(&self, events: &[(u64, f64)]) -> Vec<WindowResult>
pub fn process_session(&self, events: &[(u64, f64)]) -> Vec<WindowResult>
Process session windows: start a new session whenever the gap between
consecutive events exceeds gap_ms.
Sourcepub fn aggregate(values: &[f64], agg: WindowAggregation) -> f64
pub fn aggregate(values: &[f64], agg: WindowAggregation) -> f64
Apply an aggregation function to a slice of values.
Auto Trait Implementations§
impl Freeze for WindowedAggregation
impl RefUnwindSafe for WindowedAggregation
impl Send for WindowedAggregation
impl Sync for WindowedAggregation
impl Unpin for WindowedAggregation
impl UnsafeUnpin for WindowedAggregation
impl UnwindSafe for WindowedAggregation
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more