Type Alias metrics::Histogram

source ·
pub type Histogram<T> = DetailedHistogram<T, T>;
Expand description

A helper type alias for Histogram that doesn’t store details. The structure can be used in production without much memory penalty.

Aliased Type§

struct Histogram<T> {
    buckets: Vec<Bucket<T>>,
    values: Option<Vec<T>>,
}

Fields§

§buckets: Vec<Bucket<T>>§values: Option<Vec<T>>

Implementations

source§

impl<T: NumberType, D: Details<T>> DetailedHistogram<T, D>

source

fn new_internal(ranges: &[Range<T>], details: bool) -> Result<Self>

source

pub fn new(ranges: &[Range<T>]) -> Result<Self>

Creates an histogram with given ranges of buckets.

source

pub fn add(&mut self, value: D) -> Result<()>

Adds a value to histogram.

source

pub fn simple_stat(&self) -> SimpleStat<T>

Returns simple stat for the histogram.

Trait Implementations

source§

impl<T: NumberType, D: Details<T>> Debug for DetailedHistogram<T, D>

source§

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

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

impl<T: NumberType, D: Details<T>> SummaryStats<T> for DetailedHistogram<T, D>

source§

fn count(&self) -> u64

Count of data points that tracked.
source§

fn sum(&self) -> Option<T>

Sum of all data points. Returns None if count is zero.
source§

fn min(&self) -> Option<T>

Minimum value of data points. Returns None if count is zero.
source§

fn max(&self) -> Option<T>

Maximum value of data points. Returns None if count is zero.
source§

fn average(&self) -> Option<T>

Average value of data points. Returns None if count is zero.