pub struct AllocLeakDetector { /* private fields */ }Expand description
Sequential allocation leak detector combining CUSUM and e-process.
Feed per-frame allocation counts via [observe]. The detector maintains
running estimates of the baseline mean and standard deviation, then
applies both CUSUM and an e-process test to the standardised residuals.
An alert triggers when either detector fires. The evidence ledger records all intermediate state for post-mortem diagnostics.
Implementations§
Source§impl AllocLeakDetector
impl AllocLeakDetector
Sourcepub fn new(config: LeakDetectorConfig) -> Self
pub fn new(config: LeakDetectorConfig) -> Self
Create a new detector with the given configuration.
Sourcepub fn observe(&mut self, value: f64) -> LeakAlert
pub fn observe(&mut self, value: f64) -> LeakAlert
Observe a new allocation count (or byte total) for this frame.
Returns a LeakAlert indicating whether the detector triggered.
Sourcepub fn cusum_upper(&self) -> f64
pub fn cusum_upper(&self) -> f64
Current CUSUM upper statistic.
Sourcepub fn cusum_lower(&self) -> f64
pub fn cusum_lower(&self) -> f64
Current CUSUM lower statistic.
Sourcepub fn ledger(&self) -> &[EvidenceEntry]
pub fn ledger(&self) -> &[EvidenceEntry]
Access the full evidence ledger.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AllocLeakDetector
impl RefUnwindSafe for AllocLeakDetector
impl Send for AllocLeakDetector
impl Sync for AllocLeakDetector
impl Unpin for AllocLeakDetector
impl UnsafeUnpin for AllocLeakDetector
impl UnwindSafe for AllocLeakDetector
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