[−][src]Struct prometrics::metrics::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]
F: FnOnce() -> T,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,