Crate dipstick [] [src]

Reexports

pub use aggregate::*;
pub use dual::*;
pub use publish::*;
pub use statsd::*;
pub use logging::*;
pub use cache::*;

Modules

aggregate
cache
dual
error
logging
pcg32
publish
sampling
statsd

Macros

time

A convenience macro to wrap a block or an expression with a start / stop timer. Elapsed time is sent to the supplied statsd client after the computation has been performed. Expression result (if any) is transparently returned.

Structs

Count

A gauge that sends values to the metrics backend

Event

A monotonic counter metric. Since value is only ever increased by one, no value parameter is provided, preventing potential problems.

Gauge

A counter that sends values to the metrics backend

Metrics

A metric dispatch that writes directly to the metric backend (not queuing)

TimeHandle
Timer

A timer that sends values to the metrics backend Timers can record time intervals in multiple ways : - with the time! macro, which wraps an expression or block with start() and stop() calls. - with the time(Fn) method, which wraps a closure with start() and stop() calls. - with start() and stop() methods, wrapping around the operation to time - with the interval_us() method, providing an externally determined microsecond interval

Enums

MetricKind

Used to differentiate between metric kinds in the backend.

Constants

FULL_SAMPLING_RATE

Traits

AsSink
AsSource
MetricKey

A metric identifier defined by a specific metric sink implementation. Passed back to when writing a metric value May carry state specific to the sink's implementation

MetricSink

Main trait of the metrics backend API. Defines a component that can be used when setting up a metrics backend stack. Intermediate sinks transform how metrics are defined and written: - Sampling - Dual - Cache Terminal sinks store or propagate metric values to other systems. - Statsd - Log - Aggregate

MetricWriter

A sink-specific target for writing metrics to.

ToPrimitive

A generic trait for converting a value to a number.

ToSocketAddrs

A trait for objects which can be converted or resolved to one or more SocketAddr values.

Functions

aggregate

Aggregate metrics in memory. Depending on the type of metric, count, sum, minimum and maximum of values will be tracked. Needs to be connected to a publish to be useful.

cache

Cache metrics to prevent them from being re-defined on every use. Use of this should be transparent, this has no effect on the values. Stateful sinks (i.e. Aggregate) may naturally cache their definitions.

combine

Sends metrics to separate backends. Nested combine() can be used if more than two destinations are required.

log

Send metric to a logger. This uses the basic log crate as it is configured for the application.

metrics

Wrap the metrics backend to provide an application-friendly interface.

publish

Publishes all metrics from a source to a backend.

sample

Perform random sampling of values according to the specified rate.

statsd

Send metrics to a statsd server at the address and port provided.

Type Definitions

Rate
Value