pub struct LockStats {
pub read_locks: usize,
pub write_locks: usize,
pub read_contentions: usize,
pub write_contentions: usize,
pub read_wait_ms: u128,
pub write_wait_ms: u128,
pub transactions_started: usize,
pub transactions_committed: usize,
pub transactions_rolled_back: usize,
}Expand description
Statistics about lock usage and contention.
Fields§
§read_locks: usizeTotal number of successful read lock acquisitions
write_locks: usizeTotal number of successful write lock acquisitions
read_contentions: usizeTotal number of failed read lock attempts (would block)
write_contentions: usizeTotal number of failed write lock attempts (would block)
read_wait_ms: u128Total time spent waiting for read locks (milliseconds)
write_wait_ms: u128Total time spent waiting for write locks (milliseconds)
transactions_started: usizeNumber of transactions started
transactions_committed: usizeNumber of transactions committed
transactions_rolled_back: usizeNumber of transactions rolled back
Implementations§
Source§impl LockStats
impl LockStats
Sourcepub fn avg_read_wait_ms(&self) -> f64
pub fn avg_read_wait_ms(&self) -> f64
Calculate average read wait time in milliseconds.
Sourcepub fn avg_write_wait_ms(&self) -> f64
pub fn avg_write_wait_ms(&self) -> f64
Calculate average write wait time in milliseconds.
Sourcepub fn read_contention_rate(&self) -> f64
pub fn read_contention_rate(&self) -> f64
Calculate read contention rate (0.0 to 1.0).
Sourcepub fn write_contention_rate(&self) -> f64
pub fn write_contention_rate(&self) -> f64
Calculate write contention rate (0.0 to 1.0).
Sourcepub fn commit_rate(&self) -> f64
pub fn commit_rate(&self) -> f64
Calculate transaction commit rate (0.0 to 1.0).
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 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