pub struct NormalizationConfig {
pub enabled: bool,
pub interval: Duration,
pub fill_strategy: FillStrategy,
pub alignment: AlignmentStrategy,
pub buffer_size: usize,
pub interpolation_max_gap: Duration,
pub drop_outliers: bool,
pub outlier_threshold: f64,
pub emit_metrics: bool,
}Expand description
Time-series normalization configuration
Provides configuration for normalizing time-series data by aligning events to fixed intervals, filling gaps, and handling out-of-order events.
Normalization is applied before windowing to ensure consistent event time alignment and reduce skew in aggregations.
§Example
use processor::config::{NormalizationConfig, FillStrategy, AlignmentStrategy};
use std::time::Duration;
let config = NormalizationConfig::new()
.enabled()
.with_interval(Duration::from_secs(5))
.with_fill_strategy(FillStrategy::LinearInterpolation)
.with_alignment(AlignmentStrategy::Start)
.with_buffer_size(1000);Fields§
§enabled: boolEnable time-series normalization
interval: DurationFixed interval for time alignment (e.g., 1s, 5s, 1min)
fill_strategy: FillStrategyStrategy for filling missing data points
alignment: AlignmentStrategyAlignment strategy for timestamps (start, end, or center of interval)
buffer_size: usizeBuffer size for handling out-of-order events
interpolation_max_gap: DurationMaximum gap to interpolate (larger gaps use fill strategy)
drop_outliers: boolEnable outlier detection and removal
outlier_threshold: f64Outlier threshold in standard deviations (z-score)
emit_metrics: boolEnable metrics emission for normalization operations
Implementations§
Source§impl NormalizationConfig
impl NormalizationConfig
Sourcepub fn with_interval(self, interval: Duration) -> Self
pub fn with_interval(self, interval: Duration) -> Self
Set the normalization interval
§Example
use processor::config::NormalizationConfig;
use std::time::Duration;
let config = NormalizationConfig::new()
.with_interval(Duration::from_secs(5)); // Normalize to 5-second intervalsSourcepub fn with_fill_strategy(self, strategy: FillStrategy) -> Self
pub fn with_fill_strategy(self, strategy: FillStrategy) -> Self
Set the fill strategy
Sourcepub fn with_alignment(self, alignment: AlignmentStrategy) -> Self
pub fn with_alignment(self, alignment: AlignmentStrategy) -> Self
Set the alignment strategy
Sourcepub fn with_buffer_size(self, size: usize) -> Self
pub fn with_buffer_size(self, size: usize) -> Self
Set the buffer size for out-of-order events
Sourcepub fn with_interpolation_max_gap(self, gap: Duration) -> Self
pub fn with_interpolation_max_gap(self, gap: Duration) -> Self
Set the maximum gap for interpolation
Sourcepub fn with_outlier_detection(self, threshold: f64) -> Self
pub fn with_outlier_detection(self, threshold: f64) -> Self
Enable outlier detection and removal
Sourcepub fn with_metrics(self, enabled: bool) -> Self
pub fn with_metrics(self, enabled: bool) -> Self
Enable or disable metrics emission
Sourcepub fn interval_ms(&self) -> u64
pub fn interval_ms(&self) -> u64
Get interval in milliseconds
Sourcepub fn interpolation_max_gap_ms(&self) -> u64
pub fn interpolation_max_gap_ms(&self) -> u64
Get interpolation max gap in milliseconds
Trait Implementations§
Source§impl Clone for NormalizationConfig
impl Clone for NormalizationConfig
Source§fn clone(&self) -> NormalizationConfig
fn clone(&self) -> NormalizationConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NormalizationConfig
impl Debug for NormalizationConfig
Source§impl Default for NormalizationConfig
impl Default for NormalizationConfig
Source§impl<'de> Deserialize<'de> for NormalizationConfig
impl<'de> Deserialize<'de> for NormalizationConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for NormalizationConfig
impl RefUnwindSafe for NormalizationConfig
impl Send for NormalizationConfig
impl Sync for NormalizationConfig
impl Unpin for NormalizationConfig
impl UnwindSafe for NormalizationConfig
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.