[][src]Function metrical::flush

pub fn flush()

Force any buffered metrics to be published.

It is a good idea to execute this at the end of your program.

Example

use metrical::{from_env, counter, flush};

pub fn main() {
    from_env(None).expect("Unable to configure metrical");

    let counter = counter("runs".to_owned());

    // Ensure counter is dropped before the flush
    drop(counter);

    // Ensure the counter is published
    flush();
}