pub struct ContentionThresholds { /* private fields */ }Expand description
Thresholds used to classify one execution as hotly contended.
Implementations§
Source§impl ContentionThresholds
impl ContentionThresholds
Sourcepub fn new(min_attempts: u32, min_conflicts: u32, conflict_ratio: f64) -> Self
pub fn new(min_attempts: u32, min_conflicts: u32, conflict_ratio: f64) -> Self
Creates contention thresholds from raw values.
The conflict ratio is clamped to [0.0, 1.0].
§Parameters
min_attempts: Minimum attempts before ratio check is meaningful.min_conflicts: Minimum absolute conflicts required.conflict_ratio: Minimum conflict ratio (clamped to [0.0, 1.0]).
§Returns
A normalized ContentionThresholds value.
Sourcepub fn min_attempts(&self) -> u32
pub fn min_attempts(&self) -> u32
Returns the minimum attempt count.
§Returns
Minimum number of attempts before a ratio is considered meaningful.
Sourcepub fn min_conflicts(&self) -> u32
pub fn min_conflicts(&self) -> u32
Returns the minimum conflict count.
§Returns
Minimum raw number of conflicts required to be considered hot.
Sourcepub fn conflict_ratio(&self) -> f64
pub fn conflict_ratio(&self) -> f64
Trait Implementations§
Source§impl Clone for ContentionThresholds
impl Clone for ContentionThresholds
Source§fn clone(&self) -> ContentionThresholds
fn clone(&self) -> ContentionThresholds
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 moreSource§impl Debug for ContentionThresholds
impl Debug for ContentionThresholds
Source§impl Default for ContentionThresholds
impl Default for ContentionThresholds
Source§impl PartialEq for ContentionThresholds
impl PartialEq for ContentionThresholds
impl Copy for ContentionThresholds
impl StructuralPartialEq for ContentionThresholds
Auto Trait Implementations§
impl Freeze for ContentionThresholds
impl RefUnwindSafe for ContentionThresholds
impl Send for ContentionThresholds
impl Sync for ContentionThresholds
impl Unpin for ContentionThresholds
impl UnsafeUnpin for ContentionThresholds
impl UnwindSafe for ContentionThresholds
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