fralalonde/dipstick

Timer default output format

gregod opened this issue · 1 comments

The handbook states that the "Timer's default output format is milliseconds", however when using a timer with an atomic bucket and regular flushs to stdout the format seems to be microseconds.

extern crate dipstick;

use std::time::Duration;
use std::io;
use dipstick::*;

fn main() {
    let metrics = AtomicBucket::new().add_prefix("test");
    metrics.set_drain(Stream::write_to(io::stdout()));
    metrics.flush_every(Duration::from_secs(1));
    let timer = metrics.timer("timer_a");
    timer.interval_us(1);
    loop {
    }
}

yields:

test.timer_a 1

You're right, documentation is behind the newer versions on this point, timers now have microseconds precision. The goal is to be "accurate enough" for production use without going into profiler/nanoseconds territory. I'll fix the handbook. Thanks!