process_metrics/
process_metrics.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
extern crate prometrics;
#[macro_use]
extern crate trackable;

use prometrics::metrics::ProcessMetricsCollector;
use trackable::error::Failure;

fn main() {
    prometrics::default_registry().register(ProcessMetricsCollector::new());

    let mut gatherer = track_try_unwrap!(prometrics::default_gatherer()
        .lock()
        .map_err(|e| Failure::from_error(e.to_string())));
    for metric in gatherer.gather() {
        println!("{}", metric);
    }
}