pub struct MemoryReport {
pub duration: Duration,
pub current_snapshot: MemorySnapshot,
pub peak_bytes: u64,
pub avg_bytes: u64,
pub snapshots: Vec<MemorySnapshot>,
pub potential_leak: bool,
pub allocation_rate: f64,
}Expand description
Memory profiling report.
Fields§
§duration: DurationTotal profiling duration.
current_snapshot: MemorySnapshotCurrent memory snapshot.
peak_bytes: u64Peak memory usage in bytes.
avg_bytes: u64Average memory usage in bytes.
snapshots: Vec<MemorySnapshot>All collected snapshots.
potential_leak: boolWhether a potential memory leak was detected.
allocation_rate: f64Allocation rate (allocations per second).
Implementations§
Source§impl MemoryReport
impl MemoryReport
Sourcepub fn current_mb(&self) -> f64
pub fn current_mb(&self) -> f64
Get current memory in megabytes.
Sourcepub fn check_limits(&self, max_mb: f64) -> bool
pub fn check_limits(&self, max_mb: f64) -> bool
Check if memory usage is within acceptable limits.
Trait Implementations§
Source§impl Clone for MemoryReport
impl Clone for MemoryReport
Source§fn clone(&self) -> MemoryReport
fn clone(&self) -> MemoryReport
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 moreAuto Trait Implementations§
impl Freeze for MemoryReport
impl RefUnwindSafe for MemoryReport
impl Send for MemoryReport
impl Sync for MemoryReport
impl Unpin for MemoryReport
impl UnsafeUnpin for MemoryReport
impl UnwindSafe for MemoryReport
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