pub struct MemorySnapshot {
pub timestamp: u64,
pub instant: Instant,
pub stats: AllocationStats,
pub histogram: SizeHistogram,
pub pools: PoolSnapshot,
pub label: String,
}Expand description
A point-in-time snapshot of memory state.
Fields§
§timestamp: u64Unix timestamp in milliseconds.
instant: InstantInstant for duration calculations.
stats: AllocationStatsAllocation statistics.
histogram: SizeHistogramSize histogram.
pools: PoolSnapshotPool snapshot.
label: StringLabel for this snapshot.
Implementations§
Source§impl MemorySnapshot
impl MemorySnapshot
Sourcepub fn capture(tracker: &AllocationTracker) -> Self
pub fn capture(tracker: &AllocationTracker) -> Self
Capture a new snapshot.
Sourcepub fn capture_labeled(
tracker: &AllocationTracker,
label: impl Into<String>,
) -> Self
pub fn capture_labeled( tracker: &AllocationTracker, label: impl Into<String>, ) -> Self
Capture a labeled snapshot.
Sourcepub fn diff(&self, other: &MemorySnapshot) -> SnapshotDiff
pub fn diff(&self, other: &MemorySnapshot) -> SnapshotDiff
Compare this snapshot with another (self - other).
Sourcepub fn current_bytes(&self) -> usize
pub fn current_bytes(&self) -> usize
Get total bytes currently allocated.
Sourcepub fn peak_bytes(&self) -> usize
pub fn peak_bytes(&self) -> usize
Get peak bytes allocated.
Trait Implementations§
Source§impl Clone for MemorySnapshot
impl Clone for MemorySnapshot
Source§fn clone(&self) -> MemorySnapshot
fn clone(&self) -> MemorySnapshot
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 MemorySnapshot
impl RefUnwindSafe for MemorySnapshot
impl Send for MemorySnapshot
impl Sync for MemorySnapshot
impl Unpin for MemorySnapshot
impl UnwindSafe for MemorySnapshot
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