pub struct FlakeConfig {
pub alpha: f64,
pub lambda: f64,
pub sigma: f64,
pub variance_window: usize,
pub min_observations: usize,
pub enable_logging: bool,
pub threshold: Option<f64>,
}Expand description
Configuration for the flake detector.
Fields§
§alpha: f64Significance level α. Fail when E_t > 1/α.
Lower α → more conservative (fewer false alarms). Default: 0.05.
lambda: f64Betting intensity λ. Higher values detect deviations faster
but are more sensitive to noise. Default: 0.5.
sigma: f64Prior estimate of standard deviation for latency residuals. Used in the e-value formula. Default: 1.0 (normalized units).
variance_window: usizeRolling window size for empirical variance estimation. Set to 0 to use fixed sigma. Default: 50.
min_observations: usizeMinimum observations before making decisions. Helps with warm-up. Default: 3.
enable_logging: boolEnable JSONL-compatible evidence logging. Default: false.
threshold: Option<f64>Minimum e-value before flagging as flaky (1/alpha). Computed from alpha but can be overridden.
Implementations§
Source§impl FlakeConfig
impl FlakeConfig
Sourcepub fn with_lambda(self, lambda: f64) -> Self
pub fn with_lambda(self, lambda: f64) -> Self
Set the betting intensity lambda.
Sourcepub fn with_sigma(self, sigma: f64) -> Self
pub fn with_sigma(self, sigma: f64) -> Self
Set the prior sigma.
Sourcepub fn with_variance_window(self, window: usize) -> Self
pub fn with_variance_window(self, window: usize) -> Self
Set the variance window size.
Sourcepub fn with_min_observations(self, min: usize) -> Self
pub fn with_min_observations(self, min: usize) -> Self
Set minimum observations.
Sourcepub fn with_logging(self, enabled: bool) -> Self
pub fn with_logging(self, enabled: bool) -> Self
Enable logging.
Trait Implementations§
Source§impl Clone for FlakeConfig
impl Clone for FlakeConfig
Source§fn clone(&self) -> FlakeConfig
fn clone(&self) -> FlakeConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more