pub struct FastStatsCollector {
pub deallocation_count: AtomicU64,
pub total_deallocated: AtomicU64,
/* private fields */
}
Expand description
Optimized statistics collector that avoids lock contention
Fields§
§deallocation_count: AtomicU64
§total_deallocated: AtomicU64
Implementations§
Source§impl FastStatsCollector
impl FastStatsCollector
pub fn new() -> Self
Sourcepub fn record_allocation_fast(&self, size: usize)
pub fn record_allocation_fast(&self, size: usize)
Fast path: just increment counters (no locks)
Sourcepub fn record_allocation_detailed(&self, size: usize)
pub fn record_allocation_detailed(&self, size: usize)
Slow path: record detailed data (uses lock, but only when needed)
pub fn record_deallocation(&self, size: usize)
Sourcepub fn get_basic_stats(&self) -> BasicStats
pub fn get_basic_stats(&self) -> BasicStats
Get basic stats without any locks
Sourcepub fn get_detailed_stats(&self) -> Option<DetailedStats>
pub fn get_detailed_stats(&self) -> Option<DetailedStats>
Get detailed stats (may use lock, but with timeout)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FastStatsCollector
impl !RefUnwindSafe for FastStatsCollector
impl Send for FastStatsCollector
impl Sync for FastStatsCollector
impl Unpin for FastStatsCollector
impl UnwindSafe for FastStatsCollector
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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