Expand description
Monitor a tokio runtime.
§Usage
use measured::MetricGroup;
#[derive(MetricGroup)]
#[metric(new())]
struct MyAppMetrics {
#[cfg(tokio_unstable)]
#[metric(namespace = "tokio")]
#[metric(init = measured_tokio::RuntimeCollector::current())]
tokio: measured_tokio::RuntimeCollector,
// other metrics
}
#[tokio::main]
async fn main() {
let metrics = MyAppMetrics::new();
// when you run metrics.collect_group_into(...), you will sample tokio to get runtime state.
}Structs§
- Named
Runtimes Collector - A collector which contains multiple named tokio runtimes
- Runtime
Collector - A collector which exports the current state of tokio metrics