[][src]Struct prometrics::metrics::Summary

pub struct Summary(_);

Summary samples observations (usually things like request durations and response sizes).

It provides a total count of observations and a sum of all observed values, and it calculates configurable quantiles over a sliding time window.

Cloned summaries share the same buckets.

Methods

impl Summary[src]

pub fn new(name: &str, window: Duration) -> Result<Self>[src]

Makes a new Summary instance.

Note that it is recommended to create this via SummaryBuilder.

pub fn metric_name(&self) -> &MetricName[src]

Returns the name of this summary.

pub fn help(&self) -> Option<&str>[src]

Returns the help of this summary.

pub fn labels(&self) -> &Labels[src]

Returns the user defined labels of this summary.

pub fn labels_mut(&mut self) -> LabelsMut[src]

Returns the mutable user defined labels of this summary.

pub fn timestamp(&self) -> &Timestamp[src]

Returns the timestamp of this summary.

pub fn timestamp_mut(&self) -> TimestampMut[src]

Returns the mutable timestamp of this summary.

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

Returns the total observation count.

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

Returns the sum of the observed values.

pub fn quantiles(&self) -> Vec<(Quantile, f64)>[src]

Calculates and returns the quantile-value pairs of this summary.

pub fn observe(&self, value: f64)[src]

Observes a value.

pub fn time<F, T>(&self, f: F) -> T where
    F: FnOnce() -> T, 
[src]

Measures the exeuction time of f and observes its duration in seconds.

pub fn collector(&self) -> SummaryCollector[src]

Returns a collector for this histogram.

Trait Implementations

impl Clone for Summary[src]

impl Debug for Summary[src]

impl Display for Summary[src]

impl From<Summary> for Metric[src]

Auto Trait Implementations

impl RefUnwindSafe for Summary

impl Send for Summary

impl Sync for Summary

impl Unpin for Summary

impl UnwindSafe for Summary

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> ToString for T where
    T: Display + ?Sized
[src]

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.