dipstick 0.9.4

Fast, all-purpose metrics library decoupling instrumentation from reporting backends. Like logging frameworks but with counters, timers and gauges. Supports combined outputs (e.g. log + graphite), sampling, aggregation, scheduled push, etc.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Use the metrics backend directly to log a metric value.
//! Applications should use the metrics()-provided instruments instead.

use dipstick::{Input, InputScope, labels};

fn main() {
    raw_write()
}

pub fn raw_write() {
    // setup dual metric channels
    let metrics_log = dipstick::Log::to_log().metrics();

    // define and send metrics using raw channel API
    let counter = metrics_log.new_metric("count_a".into(), dipstick::InputKind::Counter);
    counter.write(1, labels![]);
}