pub struct StatsSnapshot {
pub attempts: usize,
pub contentions: usize,
pub acquisitions: usize,
pub total_wait_us: usize,
pub max_wait_us: usize,
pub total_hold_us: usize,
pub max_hold_us: usize,
pub starvation: usize,
}Expand description
统计快照。
Fields§
§attempts: usize尝试次数。
contentions: usize发生竞争的次数。
acquisitions: usize成功获取次数。
total_wait_us: usize累计等待时间。
max_wait_us: usize最大等待时间。
total_hold_us: usize累计持有时间。
max_hold_us: usize最大持有时间。
starvation: usize超过阈值的等待次数。
Implementations§
Source§impl StatsSnapshot
impl StatsSnapshot
Sourcepub fn avg_wait_us(&self) -> usize
pub fn avg_wait_us(&self) -> usize
平均等待时间。
Sourcepub fn avg_hold_us(&self) -> usize
pub fn avg_hold_us(&self) -> usize
平均持有时间。
Trait Implementations§
Source§impl Clone for StatsSnapshot
impl Clone for StatsSnapshot
Source§fn clone(&self) -> StatsSnapshot
fn clone(&self) -> StatsSnapshot
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for StatsSnapshot
Auto Trait Implementations§
impl Freeze for StatsSnapshot
impl RefUnwindSafe for StatsSnapshot
impl Send for StatsSnapshot
impl Sync for StatsSnapshot
impl Unpin for StatsSnapshot
impl UnsafeUnpin for StatsSnapshot
impl UnwindSafe for StatsSnapshot
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