pub struct LockStats {
pub locks_acquired: AtomicU64,
pub locks_released_early: AtomicU64,
pub total_hold_time_ns: AtomicU64,
pub max_hold_time_ns: AtomicU64,
pub contentions: AtomicU64,
pub spin_successes: AtomicU64,
pub spin_failures: AtomicU64,
}Expand description
Lock statistics.
Fields§
§locks_acquired: AtomicU64Number of locks acquired.
locks_released_early: AtomicU64Number of locks released early (before timeout).
total_hold_time_ns: AtomicU64Total hold time in nanoseconds.
max_hold_time_ns: AtomicU64Maximum hold time in nanoseconds.
contentions: AtomicU64Number of contention events.
spin_successes: AtomicU64Number of spin successes.
spin_failures: AtomicU64Number of spin failures.
Implementations§
Source§impl LockStats
impl LockStats
Sourcepub fn record_acquire(&self)
pub fn record_acquire(&self)
Record a lock acquisition.
Sourcepub fn record_release(&self, hold_time: Duration)
pub fn record_release(&self, hold_time: Duration)
Record a lock release.
Sourcepub fn record_early_release(&self)
pub fn record_early_release(&self)
Record an early release.
Sourcepub fn record_contention(&self)
pub fn record_contention(&self)
Record a contention event.
Sourcepub fn record_spin_success(&self)
pub fn record_spin_success(&self)
Record a spin success.
Sourcepub fn record_spin_failure(&self)
pub fn record_spin_failure(&self)
Record a spin failure.
Sourcepub fn total_acquired(&self) -> u64
pub fn total_acquired(&self) -> u64
Get total locks acquired.
Sourcepub fn avg_hold_time(&self) -> Duration
pub fn avg_hold_time(&self) -> Duration
Get average hold time.
Sourcepub fn max_hold_time(&self) -> Duration
pub fn max_hold_time(&self) -> Duration
Get maximum hold time.
Sourcepub fn contention_rate(&self) -> f64
pub fn contention_rate(&self) -> f64
Get contention rate.
Sourcepub fn spin_success_rate(&self) -> f64
pub fn spin_success_rate(&self) -> f64
Get spin success rate.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for LockStats
impl RefUnwindSafe for LockStats
impl Send for LockStats
impl Sync for LockStats
impl Unpin for LockStats
impl UnsafeUnpin for LockStats
impl UnwindSafe for LockStats
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