From 5fc8e90e0231214a5b52ed0a4320d071f07b559f Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 10 Dec 2024 05:33:04 +0000 Subject: [PATCH] fix runtime metrics command Signed-off-by: Jason Volk --- src/admin/debug/commands.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/admin/debug/commands.rs b/src/admin/debug/commands.rs index d4c9a57b..a17d0800 100644 --- a/src/admin/debug/commands.rs +++ b/src/admin/debug/commands.rs @@ -773,7 +773,14 @@ pub(super) async fn memory_stats(&self) -> Result { pub(super) async fn runtime_metrics(&self) -> Result { let out = self.services.server.metrics.runtime_metrics().map_or_else( || "Runtime metrics are not available.".to_owned(), - |metrics| format!("```rs\n{metrics:#?}\n```"), + |metrics| { + format!( + "```rs\nnum_workers: {}\nnum_alive_tasks: {}\nglobal_queue_depth: {}\n```", + metrics.num_workers(), + metrics.num_alive_tasks(), + metrics.global_queue_depth() + ) + }, ); Ok(RoomMessageEventContent::text_markdown(out))