Crate dipstick [] [src]

A fast and modular metrics library decoupling app instrumentation from reporting backend. Similar to popular logging frameworks, but with counters and timers. Can be configured for combined outputs (log + statsd), random sampling, local aggregation of metrics, recurrent background publication, etc.

Reexports

pub use app::metrics;
pub use fnsink::make_sink;
pub use async::async;
pub use cache::cache;
pub use sampling::sample;
pub use aggregate::aggregate;
pub use publish::publish;
pub use publish::publish_every;
pub use publish::all_stats;
pub use publish::summary;
pub use publish::average;
pub use output::to_log;
pub use output::to_stdout;
pub use statsd::to_statsd;

Modules

aggregate

Maintain aggregated metrics for deferred reporting,

app

This module regroups the application metrics front-end.

async

Queue metrics for write on a separate thread, Metrics definitions are still synchronous. If queue size is exceeded, calling code reverts to blocking.

cache

Cache defined metrics.

core

Dipstick metrics core types and traits. This is mostly centered around the backend. Application-facing types are in the app module.

fnsink

A mechanism to dynamically define new sink implementations.

macros

Publicly exposed metric macros are defined here. Although dipstick does not have a macro-based API, in some situations they can make instrumented code simpler.

multi

Dispatch metrics to multiple sinks.

output

Standard stateless metric outputs.

publish

Publishes metrics values from a source to a sink.

sampling

Reduce the amount of data to process or transfer by statistically dropping some of it.

schedule

Task scheduling facilities.

selfmetrics

Internal Dipstick metrics. Collect statistics about various metrics modules at runtime. Stats can can be obtained for publication from selfstats::SOURCE.

statsd

Send metrics to a statsd server.

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.