pub struct PoolStats {
pub total_allocations: AtomicU64,
pub total_deallocations: AtomicU64,
pub cache_hits: AtomicU64,
pub cache_misses: AtomicU64,
pub bytes_in_pool: AtomicUsize,
pub peak_bytes: AtomicUsize,
pub compactions: AtomicU64,
}Expand description
Pool statistics
Fields§
§total_allocations: AtomicU64Total allocations from pool
total_deallocations: AtomicU64Total deallocations to pool
cache_hits: AtomicU64Cache hits (allocated from pool)
cache_misses: AtomicU64Cache misses (allocated from system)
bytes_in_pool: AtomicUsizeCurrent bytes in pool
peak_bytes: AtomicUsizePeak bytes in pool
compactions: AtomicU64Number of compactions
Implementations§
Source§impl PoolStats
impl PoolStats
Sourcepub fn record_allocation(&self, from_pool: bool)
pub fn record_allocation(&self, from_pool: bool)
Record an allocation
Sourcepub fn record_deallocation(&self, size: usize)
pub fn record_deallocation(&self, size: usize)
Record a deallocation
Sourcepub fn record_compaction(&self, bytes_freed: usize)
pub fn record_compaction(&self, bytes_freed: usize)
Record a compaction
Sourcepub fn current_size(&self) -> usize
pub fn current_size(&self) -> usize
Get current pool size
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PoolStats
impl RefUnwindSafe for PoolStats
impl Send for PoolStats
impl Sync for PoolStats
impl Unpin for PoolStats
impl UnsafeUnpin for PoolStats
impl UnwindSafe for PoolStats
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