Expand description
Monitor a process.
This crate only supports Linux platform.
§Usage
use measured::MetricGroup;
#[derive(MetricGroup)]
#[metric(new())]
struct MyAppMetrics {
#[cfg(target_os = "linux")]
#[metric(namespace = "process")]
#[metric(init = measured_process::ProcessCollector::for_self())]
process: measured_process::ProcessCollector,
// other metrics
}
let metrics = MyAppMetrics::new();
// when you run metrics.collect_group_into(...), you will sample procfs to get process stats.
Structs§
- Process
Collector - A collector which exports the current state of process metrics including CPU, memory and file descriptor usage, thread count, as well as the process start time for the given process id.