From 4d4a70d290511671c13a233471a9a20714dcaa84 Mon Sep 17 00:00:00 2001 From: asonix Date: Wed, 22 Mar 2023 22:17:41 -0500 Subject: [PATCH] Add comments to example --- examples/metrics-example/src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/metrics-example/src/main.rs b/examples/metrics-example/src/main.rs index fe19174..84b025c 100644 --- a/examples/metrics-example/src/main.rs +++ b/examples/metrics-example/src/main.rs @@ -28,6 +28,7 @@ pub struct MyJob { async fn main() -> Result<(), Error> { let env_filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("warn")); + // Install the metrics subscriber let stats_handle = background_jobs::metrics::install()?; tracing_subscriber::fmt::fmt() @@ -56,6 +57,7 @@ async fn main() -> Result<(), Error> { actix_rt::spawn(async move { loop { actix_rt::time::sleep(Duration::from_millis(500)).await; + // Get the current stats for the background jobs processor println!("{:?}", stats_handle.get()); } });