[][src]Struct sketches_ddsketch::DDSketch

pub struct DDSketch { /* fields omitted */ }

This struct represents a DDSketch

Implementations

impl DDSketch[src]

pub fn new(config: Config) -> Self[src]

Construct a DDSketch. Requires a Config specifying the parameters of the sketch

pub fn add(&mut self, v: f64)[src]

Add the sample to the sketch

pub fn quantile(&self, q: f64) -> Result<Option<f64>, DDSketchError>[src]

Return the quantile value for quantiles between 0.0 and 1.0. Result is an error, represented as DDSketchError::Quantile if the requested quantile is outside of that range.

If the sketch is empty the result is None, else Some(v) for the quantile value.

pub fn min(&self) -> Option<f64>[src]

Returns the minimum value seen, or None if sketch is empty

pub fn max(&self) -> Option<f64>[src]

Returns the maximum value seen, or None if sketch is empty

pub fn sum(&self) -> Option<f64>[src]

Returns the sum of values seen, or None if sketch is empty

pub fn count(&self) -> usize[src]

Returns the number of values added to the sketch

pub fn length(&self) -> usize[src]

Returns the length of the underlying Store. This is mainly only useful for understanding how much the sketch has grown given the inserted values.

pub fn merge(&mut self, o: &DDSketch) -> Result<(), DDSketchError>[src]

Merge the contents of another sketch into this one. The sketch that is merged into this one is unchanged after the merge.

Trait Implementations

impl Clone for DDSketch[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.