pub struct AllocationStats {
pub total_allocations: u64,
pub total_deallocations: u64,
pub total_bytes_allocated: usize,
pub total_bytes_deallocated: usize,
pub current_allocations: u64,
pub current_bytes: usize,
pub peak_bytes: usize,
pub uptime: Duration,
}Expand description
Summary statistics for allocations.
Fields§
§total_allocations: u64Total number of allocations.
total_deallocations: u64Total number of deallocations.
total_bytes_allocated: usizeTotal bytes ever allocated.
total_bytes_deallocated: usizeTotal bytes ever deallocated.
current_allocations: u64Current number of active allocations.
current_bytes: usizeCurrent bytes allocated.
peak_bytes: usizePeak bytes allocated.
uptime: DurationTime since tracking started.
Implementations§
Source§impl AllocationStats
impl AllocationStats
Sourcepub fn net_allocations(&self) -> i64
pub fn net_allocations(&self) -> i64
Get net allocations (allocs - deallocs).
Sourcepub fn allocation_rate(&self) -> f64
pub fn allocation_rate(&self) -> f64
Get allocation rate (allocations per second).
Sourcepub fn avg_allocation_size(&self) -> usize
pub fn avg_allocation_size(&self) -> usize
Get average allocation size.
Sourcepub fn has_potential_leaks(&self) -> bool
pub fn has_potential_leaks(&self) -> bool
Check if there are potential leaks.
Trait Implementations§
Source§impl Clone for AllocationStats
impl Clone for AllocationStats
Source§fn clone(&self) -> AllocationStats
fn clone(&self) -> AllocationStats
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 moreSource§impl Debug for AllocationStats
impl Debug for AllocationStats
Source§impl Default for AllocationStats
impl Default for AllocationStats
Source§fn default() -> AllocationStats
fn default() -> AllocationStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AllocationStats
impl RefUnwindSafe for AllocationStats
impl Send for AllocationStats
impl Sync for AllocationStats
impl Unpin for AllocationStats
impl UnwindSafe for AllocationStats
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