Skip to main content

Distribution

Struct Distribution 

Source
pub struct Distribution<'a> { /* private fields */ }
Expand description

A timing distribution used by compatibility-specific summaries.

Sorting is lazy, so mean-only SDK calls do not pay an allocation or sort.

Implementations§

Source§

impl<'a> Distribution<'a>

Source

pub fn from_slice(samples: &'a [u64]) -> Self

Borrow nanosecond samples and prepare safe shared accumulation.

Source

pub fn from_vec(samples: Vec<u64>) -> Self

Own and eagerly sort nanosecond samples for one-allocation order statistics.

Source

pub fn cli_v1_summary(&self) -> Option<CliV1Summary>

Summarize with the released CLI’s floor and nearest-rank rules.

Source

pub fn sdk_v1_summary(&self) -> SdkV1Summary

Summarize with the released SDK’s floating-point and rounded-index rules.

Source

pub fn sdk_v1_mean(&self) -> f64

Return the SDK’s floating-point mean, or zero for no samples.

Source

pub fn sdk_v1_median(&self) -> f64

Return the SDK’s floating-point median, or zero for no samples.

Source

pub fn sdk_v1_std_dev(&self) -> f64

Return the SDK’s sample standard deviation, or zero below two samples.

Source

pub fn min(&self) -> Option<u64>

Return the minimum sample without sorting.

Source

pub fn max(&self) -> Option<u64>

Return the maximum sample without sorting.

Source

pub fn sdk_v1_percentile(&self, percentile: f64) -> f64

Select a percentile with the SDK’s clamped, rounded (n - 1) index.

Trait Implementations§

Source§

impl<'a> Debug for Distribution<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !Freeze for Distribution<'a>

§

impl<'a> RefUnwindSafe for Distribution<'a>

§

impl<'a> Send for Distribution<'a>

§

impl<'a> Sync for Distribution<'a>

§

impl<'a> Unpin for Distribution<'a>

§

impl<'a> UnsafeUnpin for Distribution<'a>

§

impl<'a> UnwindSafe for Distribution<'a>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.