pub struct MemoryUsageResult {
pub baseline_memory: usize,
pub peak_memory: usize,
pub final_memory: usize,
pub memory_delta: i64,
pub peak_delta: usize,
pub samples: Vec<(Instant, usize)>,
}Expand description
Result of memory usage tracking
Fields§
§baseline_memory: usizeMemory usage at start of operation
peak_memory: usizePeak memory usage during operation
final_memory: usizeMemory usage at end of operation
memory_delta: i64Net memory change (can be negative)
peak_delta: usizePeak memory increase from baseline
samples: Vec<(Instant, usize)>Time-series memory samples
Implementations§
Source§impl MemoryUsageResult
impl MemoryUsageResult
Sourcepub fn has_potential_leak(&self, threshold_bytes: usize) -> bool
pub fn has_potential_leak(&self, threshold_bytes: usize) -> bool
Check if there was a memory leak (final > baseline by significant amount)
Sourcepub fn efficiency_score(&self) -> f64
pub fn efficiency_score(&self) -> f64
Get memory efficiency score (0-1, lower peak usage is better)
Trait Implementations§
Source§impl Clone for MemoryUsageResult
impl Clone for MemoryUsageResult
Auto Trait Implementations§
impl Freeze for MemoryUsageResult
impl RefUnwindSafe for MemoryUsageResult
impl Send for MemoryUsageResult
impl Sync for MemoryUsageResult
impl Unpin for MemoryUsageResult
impl UnsafeUnpin for MemoryUsageResult
impl UnwindSafe for MemoryUsageResult
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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