mirror of https://github.com/fralalonde/dipstick
24 lines
560 B
Rust
24 lines
560 B
Rust
//! A sample application sending ad-hoc counter values both to statsd _and_ to stdout.
|
|
|
|
//extern crate badlog;
|
|
extern crate dipstick;
|
|
|
|
use dipstick::*;
|
|
use std::time::Duration;
|
|
|
|
fn main() {
|
|
// badlog::init(Some("info"));
|
|
|
|
let metrics =
|
|
to_graphite("localhost:2003")
|
|
.expect("Connecting")
|
|
.with_prefix("my_app")
|
|
.open_scope();
|
|
|
|
loop {
|
|
metrics.counter("counter_a").count(123);
|
|
metrics.timer("timer_a").interval_us(2000000);
|
|
std::thread::sleep(Duration::from_millis(40));
|
|
}
|
|
}
|