metrics/
metrics.rs

1extern crate prometrics;
2extern crate tasque;
3
4use std::thread;
5use std::time::Duration;
6use tasque::TaskQueue;
7
8fn main() {
9    let queue = TaskQueue::new();
10    queue.enqueue(|| thread::sleep(Duration::from_millis(1)));
11    queue.enqueue(|| thread::sleep(Duration::from_millis(50)));
12    queue.enqueue(|| thread::sleep(Duration::from_millis(1000)));
13    thread::sleep(Duration::from_millis(100));
14
15    println!(
16        "{}",
17        prometrics::default_gatherer()
18            .lock()
19            .unwrap()
20            .gather()
21            .to_text()
22    );
23}