pub struct FlakeDetector { /* private fields */ }Expand description
Anytime-valid flake detector using e-process statistics.
Implementations§
Source§impl FlakeDetector
impl FlakeDetector
Sourcepub fn new(config: FlakeConfig) -> Self
pub fn new(config: FlakeConfig) -> Self
Create a new flake detector.
Sourcepub fn observe(&mut self, residual: f64) -> FlakeDecision
pub fn observe(&mut self, residual: f64) -> FlakeDecision
Observe a latency deviation (residual).
The residual should be the difference between observed latency and expected latency, ideally normalized.
Sourcepub fn observe_batch(&mut self, residuals: &[f64]) -> FlakeDecision
pub fn observe_batch(&mut self, residuals: &[f64]) -> FlakeDecision
Observe multiple residuals and return the final decision.
Sourcepub fn observation_count(&self) -> usize
pub fn observation_count(&self) -> usize
Get the observation count.
Sourcepub fn is_warmed_up(&self) -> bool
pub fn is_warmed_up(&self) -> bool
Check if the detector has warmed up.
Sourcepub fn evidence_log(&self) -> &[EvidenceLog]
pub fn evidence_log(&self) -> &[EvidenceLog]
Get the evidence log.
Sourcepub fn evidence_to_jsonl(&self) -> String
pub fn evidence_to_jsonl(&self) -> String
Export evidence log as JSONL.
Sourcepub fn current_sigma(&self) -> f64
pub fn current_sigma(&self) -> f64
Get the current sigma estimate.
Sourcepub fn config(&self) -> &FlakeConfig
pub fn config(&self) -> &FlakeConfig
Get configuration.
Source§impl FlakeDetector
impl FlakeDetector
Sourcepub fn summary(&self) -> FlakeSummary
pub fn summary(&self) -> FlakeSummary
Generate summary statistics.
Trait Implementations§
Source§impl Clone for FlakeDetector
impl Clone for FlakeDetector
Source§fn clone(&self) -> FlakeDetector
fn clone(&self) -> FlakeDetector
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FlakeDetector
impl Debug for FlakeDetector
Auto Trait Implementations§
impl Freeze for FlakeDetector
impl RefUnwindSafe for FlakeDetector
impl Send for FlakeDetector
impl Sync for FlakeDetector
impl Unpin for FlakeDetector
impl UnwindSafe for FlakeDetector
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