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]

[src]

Define a new metric.

[src]

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);
}

[src]

Open a buffered scope.

[src]

Open an unbuffered scope.

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

[src]

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

[src]

Get an event counter of the provided name.

[src]

Get a counter of the provided name.

[src]

Get a timer of the provided name.

[src]

Get a gauge of the provided name.

[src]

Intercept metric definition without changing the metric type.

[src]

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

[src]

Intercept scope creation.

Trait Implementations

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

[src]

Formats the value using the given formatter. Read more

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

[src]

Performs the conversion.

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

[src]

Perform random sampling of values according to the specified rate.

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

[src]

Join namespace and prepend in newly defined metrics.

[src]

Insert prefix in newly defined metrics.

[src]

Join namespace and prepend in newly defined metrics.

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

[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.

[src]

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.

[src]

Performs the conversion.

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

[src]

Enqueue collected metrics for dispatch on background thread.

Auto Trait Implementations

impl<M> Send for Chain<M>

impl<M> Sync for Chain<M>