pub struct AllocationStats {
pub total_allocations: u64,
pub total_deallocations: u64,
pub cache_hits: u64,
pub cache_misses: u64,
pub fragmentation_events: u64,
pub total_allocated_bytes: u64,
pub peak_allocated_bytes: u64,
pub average_allocation_size: f64,
pub allocation_latency_ms: f64,
}Expand description
Allocation statistics
Fields§
§total_allocations: u64§total_deallocations: u64§cache_hits: u64§cache_misses: u64§fragmentation_events: u64§total_allocated_bytes: u64§peak_allocated_bytes: u64§average_allocation_size: f64§allocation_latency_ms: f64Implementations§
Source§impl AllocationStats
impl AllocationStats
pub fn record_allocation( &mut self, size: usize, cache_hit: bool, latency_us: u64, )
pub fn record_deallocation(&mut self, size: usize)
pub fn get_cache_hit_rate(&self) -> f64
pub fn get_fragmentation_rate(&self) -> f64
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 UnsafeUnpin 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
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