pub struct AtomicStats { /* private fields */ }Expand description
共享统计器。
Implementations§
Source§impl AtomicStats
impl AtomicStats
Sourcepub fn record_wait(
&self,
wait_us: usize,
contended: bool,
starvation_threshold_us: usize,
)
pub fn record_wait( &self, wait_us: usize, contended: bool, starvation_threshold_us: usize, )
记录一次获取成功。
Sourcepub fn record_hold(&self, hold_us: usize)
pub fn record_hold(&self, hold_us: usize)
记录一次持有时间。
Sourcepub fn record_hold_sample(&self, hold_us: usize)
pub fn record_hold_sample(&self, hold_us: usize)
记录一次只关心持有时长的样本。
Sourcepub fn snapshot(&self) -> StatsSnapshot
pub fn snapshot(&self) -> StatsSnapshot
读取快照。
Auto Trait Implementations§
impl !Freeze for AtomicStats
impl RefUnwindSafe for AtomicStats
impl Send for AtomicStats
impl Sync for AtomicStats
impl Unpin for AtomicStats
impl UnsafeUnpin for AtomicStats
impl UnwindSafe for AtomicStats
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