pub struct LockFreeStats {
pub successes: AtomicUsize,
pub failures: AtomicUsize,
pub retries: AtomicUsize,
}Expand description
Statistics for lock-free operations
Fields§
§successes: AtomicUsizeNumber of successful operations
failures: AtomicUsizeNumber of failed operations (contention)
retries: AtomicUsizeNumber of retries
Implementations§
Source§impl LockFreeStats
impl LockFreeStats
Sourcepub fn record_success(&self)
pub fn record_success(&self)
Record a success
Sourcepub fn record_failure(&self)
pub fn record_failure(&self)
Record a failure
Sourcepub fn record_retry(&self)
pub fn record_retry(&self)
Record a retry
Sourcepub fn success_rate(&self) -> f64
pub fn success_rate(&self) -> f64
Calculate success rate
Trait Implementations§
Source§impl Debug for LockFreeStats
impl Debug for LockFreeStats
Source§impl Default for LockFreeStats
impl Default for LockFreeStats
Source§fn default() -> LockFreeStats
fn default() -> LockFreeStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for LockFreeStats
impl RefUnwindSafe for LockFreeStats
impl Send for LockFreeStats
impl Sync for LockFreeStats
impl Unpin for LockFreeStats
impl UnsafeUnpin for LockFreeStats
impl UnwindSafe for LockFreeStats
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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