Struct prometrics::metrics::Histogram
[−]
[src]
pub struct Histogram(_);
Histogram
samples observations (usually things like request durations or response sizes) and
counts them in configurable buckets.
It also provides a sum of all observed values.
Cloned histograms share the same buckets.
Methods
impl Histogram
[src]
pub fn new(name: &str) -> Result<Self>
[src]
Makes a new Histogram
instance.
Note that it is recommended to create this via HistogramBuilder
.
pub fn metric_name(&self) -> &MetricName
[src]
Returns the name of this histogram.
pub fn help(&self) -> Option<&str>
[src]
Returns the help of this histogram.
pub fn labels(&self) -> &Labels
[src]
Returns the user defined labels of this histogram.
pub fn labels_mut(&mut self) -> LabelsMut
[src]
Returns the mutable user defined labels of this histogram.
pub fn timestamp(&self) -> &Timestamp
[src]
Returns the timestamp of this histogram.
pub fn timestamp_mut(&mut self) -> TimestampMut
[src]
Returns the mutable timestamp of this histogram.
pub fn buckets(&self) -> &[Bucket]
[src]
Returns the buckets of this histogram.
ⓘImportant traits for CumulativeBuckets<'a>pub fn cumulative_buckets(&self) -> CumulativeBuckets
[src]
Returns the cumulative buckets of this histogram.
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 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) -> HistogramCollector
[src]
Returns a collector for this histogram.
Trait Implementations
impl From<Histogram> for Metric
[src]
impl Debug for Histogram
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for Histogram
[src]
fn clone(&self) -> Histogram
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more