pub struct ResourceStatsSnapshot {
pub allocated_bytes: usize,
pub allocated_objects: usize,
pub deallocated_bytes: usize,
pub deallocated_objects: usize,
pub cpu_time_nanos: u64,
}Expand description
Snapshot of allocation statistics for a group.
Fields§
§allocated_bytes: usizeNumber of allocated bytes since the last snapshot.
allocated_objects: usizeNumber of allocated objects since the last snapshot.
deallocated_bytes: usizeNumber of deallocated bytes since the last snapshot.
deallocated_objects: usizeNumber of deallocated objects since the last snapshot.
cpu_time_nanos: u64Cumulative CPU time in nanoseconds consumed by this group since the last snapshot.
Implementations§
Source§impl ResourceStatsSnapshot
impl ResourceStatsSnapshot
Sourcepub fn live_bytes(&self) -> usize
pub fn live_bytes(&self) -> usize
Returns the number of live allocated bytes.
Saturates at zero rather than underflowing. The allocation and deallocation counters this is derived from are read independently, so a deallocation landing between the two reads can momentarily make the difference negative.
Sourcepub fn live_objects(&self) -> usize
pub fn live_objects(&self) -> usize
Returns the number of live allocated objects.
Saturates at zero, for the same reason as live_bytes.
Auto Trait Implementations§
impl Freeze for ResourceStatsSnapshot
impl RefUnwindSafe for ResourceStatsSnapshot
impl Send for ResourceStatsSnapshot
impl Sync for ResourceStatsSnapshot
impl Unpin for ResourceStatsSnapshot
impl UnwindSafe for ResourceStatsSnapshot
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> Track for T
impl<T> Track for T
Source§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self> ⓘ
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self> ⓘ
Instruments this type by attaching the given resource group token, returning a
Tracked wrapper. Read more