pub struct ContinuousForecastConfig {
pub measurement: String,
pub field: Option<String>,
pub model_type: ModelType,
pub update_interval_points: usize,
pub refit_mae_multiplier: f64,
pub enabled: bool,
pub min_fit_points: usize,
pub max_buffer_size: usize,
pub min_mae_samples: usize,
}Expand description
Configuration for continuous forecasting on a measurement.
Fields§
§measurement: StringMeasurement to forecast.
field: Option<String>Field to forecast (default: first f64 field).
model_type: ModelTypeModel type to use.
update_interval_points: usizeRe-fit after this many new points.
refit_mae_multiplier: f64Maximum residual MAE multiplier before full re-fit.
enabled: boolWhether continuous forecasting is enabled.
min_fit_points: usizeMinimum points needed for initial fit.
max_buffer_size: usizeMaximum buffer size for training data per series (prevents unbounded growth).
min_mae_samples: usizeMinimum number of 1-step-ahead errors before the rolling MAE is treated as meaningful.
A MAE computed from one or two residuals is noise, and it drives an
expensive decision: current > baseline × refit_mae_multiplier
triggers a full model re-fit. With a tiny window a single unlucky
residual either causes a spurious re-fit — wasted CPU on a constrained
gateway — or, if it lands in the baseline, inflates the threshold so
that genuine drift never triggers one.
Implementations§
Source§impl ContinuousForecastConfig
impl ContinuousForecastConfig
Sourcepub fn with_field(self, field: impl Into<String>) -> Self
pub fn with_field(self, field: impl Into<String>) -> Self
Set the field to monitor.
Sourcepub fn with_update_interval(self, points: usize) -> Self
pub fn with_update_interval(self, points: usize) -> Self
Set the update interval.
Sourcepub fn with_min_fit_points(self, n: usize) -> Self
pub fn with_min_fit_points(self, n: usize) -> Self
Set minimum fit points.
Sourcepub fn with_max_buffer_size(self, n: usize) -> Self
pub fn with_max_buffer_size(self, n: usize) -> Self
Set maximum buffer size per series.
Trait Implementations§
Source§impl Clone for ContinuousForecastConfig
impl Clone for ContinuousForecastConfig
Source§fn clone(&self) -> ContinuousForecastConfig
fn clone(&self) -> ContinuousForecastConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ContinuousForecastConfig
impl RefUnwindSafe for ContinuousForecastConfig
impl Send for ContinuousForecastConfig
impl Sync for ContinuousForecastConfig
impl Unpin for ContinuousForecastConfig
impl UnsafeUnpin for ContinuousForecastConfig
impl UnwindSafe for ContinuousForecastConfig
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more