Instrumentation Probe for Readings
Readings goal is to make process vital metrics intrumentation as easy as
possible.
This is the instrumentation library that must be embedded in the client
code.
Please refer to the Readings
readings_probe::instrumented_allocator!();
fn main() -> readings_probe::ReadingsResult<()> {
let mut probe =
readings_probe::Probe::new(std::fs::File::create("readings.out").unwrap()).unwrap();
let progress = probe.register_i64("progress".to_string())?;
probe.spawn_heartbeat(std::time::Duration::from_millis(1000))?;
let percent_done = 12;
progress.store(percent_done, std::sync::atomic::Ordering::Relaxed);
probe.log_event("about to get crazy")?;
probe.log_event("done")?;
Ok(())
}