pub struct LeakDetector { /* private fields */ }Expand description
Memory leak detector
Implementations§
Source§impl LeakDetector
impl LeakDetector
pub fn new() -> Self
Sourcepub fn set_sample_interval(&mut self, secs: u64)
pub fn set_sample_interval(&mut self, secs: u64)
Set sample interval
Sourcepub fn should_sample(&self) -> bool
pub fn should_sample(&self) -> bool
Check if enough time has passed for next sample
Sourcepub fn get_leaks(&self) -> Vec<LeakReport>
pub fn get_leaks(&self) -> Vec<LeakReport>
Get processes with likely memory leaks
Sourcepub fn get_all_monitored(&self) -> Vec<&ProcessHistory>
pub fn get_all_monitored(&self) -> Vec<&ProcessHistory>
Get all monitored processes sorted by memory growth
Sourcepub fn get_top_growing(&self, count: usize) -> Vec<&ProcessHistory>
pub fn get_top_growing(&self, count: usize) -> Vec<&ProcessHistory>
Get top memory growing processes
Sourcepub fn stats(&self) -> LeakDetectorStats
pub fn stats(&self) -> LeakDetectorStats
Get monitoring stats
Sourcepub fn print_summary(&self)
pub fn print_summary(&self)
Print leak detection summary
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LeakDetector
impl RefUnwindSafe for LeakDetector
impl Send for LeakDetector
impl Sync for LeakDetector
impl Unpin for LeakDetector
impl UnwindSafe for LeakDetector
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
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>
Converts
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>
Converts
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