pub struct CollapseDetector { /* private fields */ }Expand description
Per-connection collapse detector.
Implementations§
Source§impl CollapseDetector
impl CollapseDetector
pub fn new() -> Self
Sourcepub fn observe_rate(&mut self, rate: f64)
pub fn observe_rate(&mut self, rate: f64)
Record an observed instantaneous rate (bytes/s) for this connection.
Sourcepub fn observe_silence(&mut self, since_progress_s: f64, stall_timeout_s: f64)
pub fn observe_silence(&mut self, since_progress_s: f64, stall_timeout_s: f64)
Escalate on wall-clock silence, which no rate sample can express: a connection delivering nothing produces no observations at all.
pub fn mark_dead(&mut self)
pub fn health(&self) -> Health
pub fn samples(&self) -> u32
Sourcepub fn reset_after_repair(&mut self)
pub fn reset_after_repair(&mut self)
Clear detection state after work has been moved away, so the next episode is judged on fresh evidence.
Trait Implementations§
Source§impl Clone for CollapseDetector
impl Clone for CollapseDetector
Source§fn clone(&self) -> CollapseDetector
fn clone(&self) -> CollapseDetector
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CollapseDetector
impl Debug for CollapseDetector
Auto Trait Implementations§
impl Freeze for CollapseDetector
impl RefUnwindSafe for CollapseDetector
impl Send for CollapseDetector
impl Sync for CollapseDetector
impl Unpin for CollapseDetector
impl UnsafeUnpin for CollapseDetector
impl UnwindSafe for CollapseDetector
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