Skip to main content

SubMsSamples

Struct SubMsSamples 

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

Borrowing facade over a sample slice. Zero-cost - holds a reference only. Lazy-sorts internally on demand for percentile queries.

Implementations§

Source§

impl<'a> SubMsSamples<'a>

Source

pub fn new(raw: &'a [u64]) -> Self

Wrap a borrowed slice of nanosecond samples.

Source

pub fn count(&self) -> usize

Number of samples in the underlying slice.

Source

pub fn is_empty(&self) -> bool

true if the underlying slice is empty.

Source

pub fn raw(&self) -> &'a [u64]

Raw chronological sample buffer.

Source

pub fn p50(&self) -> u64

50th percentile (median).

Source

pub fn p90(&self) -> u64

90th percentile.

Source

pub fn p99(&self) -> u64

99th percentile - the standard tail-latency headline.

Source

pub fn p999(&self) -> u64

99.9th percentile - the “worst typical case”.

Source

pub fn max(&self) -> u64

Maximum observed sample, 0 if empty.

Source

pub fn mean(&self) -> u64

Arithmetic mean. 0 if empty.

Source

pub fn stddev(&self) -> u64

Sample standard deviation (n-1).

Source

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

Arbitrary quantile in [0.0, 1.0]. Sorts internally.

Source

pub fn percentile_sweep( &self, start: f64, end: f64, step: f64, ) -> Vec<(f64, u64)>

Sweep across a quantile range.

Source

pub fn cdf_buckets(&self) -> Vec<u64>

Log2-spaced CDF buckets. Only available with the histogram feature.

Source

pub fn jitter_score(&self) -> f64

Measurement-rig jitter score in [0.0, 1.0]. Only available with the jitter feature.

Source

pub fn conditional_tail_expectation(&self, q: f64) -> u64

Conditional tail expectation. Only with tail feature.

Source

pub fn tail_fatness_ratio(&self) -> f64

Tail fatness ratio (p99 / p50). Only with tail feature.

Source

pub fn hill_tail_index(&self, k: usize) -> Option<f64>

Hill estimator. Only with tail feature.

Source

pub fn iqr(&self) -> u64

Interquartile range. Only with robust feature.

Source

pub fn median_absolute_deviation(&self) -> u64

Median absolute deviation. Only with robust feature.

Source

pub fn coefficient_of_variation(&self) -> f64

Coefficient of variation. Only with robust feature.

Source

pub fn skewness(&self) -> f64

Skewness (3rd standardised moment). Only with robust feature.

Source

pub fn kurtosis(&self) -> f64

Excess kurtosis. Only with robust feature.

Source

pub fn bootstrap_percentile_ci( &self, q: f64, iters: usize, confidence: f64, seed: u64, ) -> (u64, u64)

Bootstrap CI for a percentile. Only with bootstrap feature.

Trait Implementations§

Source§

impl<'a> Clone for SubMsSamples<'a>

Source§

fn clone(&self) -> SubMsSamples<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> From<&'a [u64]> for SubMsSamples<'a>

Source§

fn from(raw: &'a [u64]) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Vec<u64>> for SubMsSamples<'a>

Source§

fn from(raw: &'a Vec<u64>) -> Self

Converts to this type from the input type.
Source§

impl<'a> Copy for SubMsSamples<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for SubMsSamples<'a>

§

impl<'a> RefUnwindSafe for SubMsSamples<'a>

§

impl<'a> Send for SubMsSamples<'a>

§

impl<'a> Sync for SubMsSamples<'a>

§

impl<'a> Unpin for SubMsSamples<'a>

§

impl<'a> UnsafeUnpin for SubMsSamples<'a>

§

impl<'a> UnwindSafe for SubMsSamples<'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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.