Struct ore::metrics::Histogram[][src]

pub struct Histogram {
    core: Arc<HistogramCore>,
}
This is supported on crate feature metrics only.
Expand description

A Metric counts individual observations from an event or sample stream in configurable buckets. Similar to a Summary, it also provides a sum of observations and an observation count.

On the Prometheus server, quantiles can be calculated from a Histogram using the histogram_quantile function in the query language.

Note that Histograms, in contrast to Summaries, can be aggregated with the Prometheus query language (see the prometheus documentation for detailed procedures). However, Histograms require the user to pre-define suitable buckets, (see linear_buckets and exponential_buckets for some helper provided here) and they are in general less accurate. The Observe method of a Histogram has a very low performance overhead in comparison with the Observe method of a Summary.

Fields

core: Arc<HistogramCore>

Implementations

with_opts creates a Histogram with the opts options.

Add a single observation to the Histogram.

Return a HistogramTimer to track a duration.

Observe execution time of a closure, in second.

Return a LocalHistogram for single thread usage.

Return accumulated sum of all samples.

Return count of all samples.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Return descriptors for metrics.

Collect metrics.

Formats the value using the given formatter. Read more

Return the protocol Metric.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more