Struct Sample

Source
pub struct Sample<T: Ord + Zero + Copy> {
    pub dropped: usize,
    pub wraps: usize,
    pub p25: T,
    pub p50: T,
    pub p75: T,
    pub p90: T,
    pub p95: T,
    pub p99: T,
    pub p99p9: T,
    pub max: T,
    pub count: usize,
}
Expand description

A sample of the state in Observations.

Fields§

§dropped: usize

Number of observations dropped due to lock contention

§wraps: usize

Number of times the observation window wrapped around

§p25: T

25th percentile observation

§p50: T

50th percentile observation

§p75: T

75th percentile observation

§p90: T

90th percentile observation

§p95: T

95th percentile observation

§p99: T

99th percentile observation

§p99p9: T

99.9th percentile observation

§max: T

Maximum observation

§count: usize

Number of observations

Implementations§

Source§

impl<T: Ord + Zero + Copy + Into<i64>> Sample<T>

Source

pub fn as_bucket_pairs(&self) -> Vec<(TimingBucket, i64)>

Returns each member of the struct along with its TimingBucket label. Each percentile is given as an i64.

Source

pub fn dropped(&self) -> usize

Returns the number of observations dropped due to the observation lock being held.

Source

pub fn wraps(&self) -> usize

Returns the number of times the observation count exceeded the available window size.

Trait Implementations§

Source§

impl<T: Debug + Ord + Zero + Copy> Debug for Sample<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: PartialEq + Ord + Zero + Copy> PartialEq for Sample<T>

Source§

fn eq(&self, other: &Sample<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Eq + Ord + Zero + Copy> Eq for Sample<T>

Source§

impl<T: Ord + Zero + Copy> StructuralPartialEq for Sample<T>

Auto Trait Implementations§

§

impl<T> Freeze for Sample<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Sample<T>
where T: RefUnwindSafe,

§

impl<T> Send for Sample<T>
where T: Send,

§

impl<T> Sync for Sample<T>
where T: Sync,

§

impl<T> Unpin for Sample<T>
where T: Unpin,

§

impl<T> UnwindSafe for Sample<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.