pub struct TimeSeriesNormalizer { /* private fields */ }Expand description
Thread-safe time-series normalizer with out-of-order handling
Implementations§
Source§impl TimeSeriesNormalizer
impl TimeSeriesNormalizer
Sourcepub fn new(config: NormalizationConfig) -> NormalizationResult<Self>
pub fn new(config: NormalizationConfig) -> NormalizationResult<Self>
Create a new normalizer with the given configuration
Sourcepub fn default_config() -> NormalizationResult<Self>
pub fn default_config() -> NormalizationResult<Self>
Create a normalizer with default configuration
Sourcepub fn normalize(&self, event: TimeSeriesEvent) -> Result<Vec<TimeSeriesEvent>>
pub fn normalize(&self, event: TimeSeriesEvent) -> Result<Vec<TimeSeriesEvent>>
Process a single time-series event and return normalized events
This method may return multiple events if there were gaps that needed to be filled. It buffers out-of-order events and emits them when the watermark advances.
Sourcepub fn normalize_batch(
&self,
events: Vec<TimeSeriesEvent>,
) -> Result<Vec<TimeSeriesEvent>>
pub fn normalize_batch( &self, events: Vec<TimeSeriesEvent>, ) -> Result<Vec<TimeSeriesEvent>>
Process a batch of events
This is more efficient than calling normalize() repeatedly as it can
optimize buffer operations and reduce lock contention.
Sourcepub fn flush(&self) -> Result<Vec<TimeSeriesEvent>>
pub fn flush(&self) -> Result<Vec<TimeSeriesEvent>>
Flush any remaining buffered events
This should be called at the end of a stream to ensure all buffered events are processed. It will emit events even if gaps remain.
Sourcepub fn stats(&self) -> Result<NormalizationStats>
pub fn stats(&self) -> Result<NormalizationStats>
Get current statistics
Sourcepub fn interval_ms(&self) -> Result<Option<i64>>
pub fn interval_ms(&self) -> Result<Option<i64>>
Get the detected or configured interval
Trait Implementations§
Source§impl Clone for TimeSeriesNormalizer
impl Clone for TimeSeriesNormalizer
Source§fn clone(&self) -> TimeSeriesNormalizer
fn clone(&self) -> TimeSeriesNormalizer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TimeSeriesNormalizer
impl RefUnwindSafe for TimeSeriesNormalizer
impl Send for TimeSeriesNormalizer
impl Sync for TimeSeriesNormalizer
impl Unpin for TimeSeriesNormalizer
impl UnwindSafe for TimeSeriesNormalizer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.