Struct dipstick::core::Chain[][src]

pub struct Chain<M> { /* fields omitted */ }

A pair of functions composing a twin "chain of command". This is the building block for the metrics backend.

Methods

impl<M> Chain<M>
[src]

Define a new metric.

Open a new metric scope. Scope metrics allow an application to emit per-operation statistics, For example, producing a per-request performance log.

Although the scope metrics can be predefined like in ['AppMetrics'], the application needs to create a scope that will be passed back when reporting scoped metric values.

use dipstick::*;
let scope_metrics = to_log();
let request_counter = scope_metrics.counter("scope_counter");
{
    let ref mut request_scope = scope_metrics.open_scope(true);
    request_counter.count(request_scope, 42);
}

Open a buffered scope.

Open an unbuffered scope.

impl<M: Send + Sync + Clone + 'static> Chain<M>
[src]

Create a new metric chain with the provided metric definition and scope creation functions.

Get an event counter of the provided name.

Get a counter of the provided name.

Get a timer of the provided name.

Get a gauge of the provided name.

Intercept metric definition without changing the metric type.

Intercept both metric definition and scope creation, possibly changing the metric type.

Intercept scope creation.

Trait Implementations

impl<M> Debug for Chain<M>
[src]

Formats the value using the given formatter. Read more

impl<M: Clone> Clone for Chain<M>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<M> From<Chain<M>> for AppMetrics<M>
[src]

Performs the conversion.

impl<M: Send + Sync + 'static + Clone> WithSamplingRate for Chain<M>
[src]

Perform random sampling of values according to the specified rate.

impl<M: Send + Sync + Clone + 'static> WithNamespace for Chain<M>
[src]

Join namespace and prepend in newly defined metrics.

Insert prefix in newly defined metrics.

Join namespace and prepend in newly defined metrics.

impl<M: Send + Sync + Clone + 'static> WithCache for Chain<M>
[src]

Cache metrics to prevent them from being re-defined on every use.

impl<M1, M2> From<(Chain<M1>, Chain<M2>)> for Chain<(M1, M2)> where
    M1: 'static + Clone + Send + Sync,
    M2: 'static + Clone + Send + Sync
[src]

Two chains of different types can be combined in a tuple. The chains will act as one, each receiving calls in the order the appear in the tuple. For more than two types, make tuples of tuples, "Yo Dawg" style.

Performs the conversion.

impl<'a, M> From<&'a [Chain<M>]> for Chain<Vec<M>> where
    M: 'static + Clone + Send + Sync
[src]

Multiple chains of the same type can be combined in a slice. The chains will act as one, each receiving calls in the order the appear in the slice.

Performs the conversion.

impl<M: Send + Sync + Clone + 'static> WithAsyncQueue for Chain<M>
[src]

Enqueue collected metrics for dispatch on background thread.

Auto Trait Implementations

impl<M> Send for Chain<M>

impl<M> Sync for Chain<M>