fix runtime metrics command
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
cd67ca6c57
commit
5fc8e90e02
1 changed files with 8 additions and 1 deletions
|
@ -773,7 +773,14 @@ pub(super) async fn memory_stats(&self) -> Result<RoomMessageEventContent> {
|
||||||
pub(super) async fn runtime_metrics(&self) -> Result<RoomMessageEventContent> {
|
pub(super) async fn runtime_metrics(&self) -> Result<RoomMessageEventContent> {
|
||||||
let out = self.services.server.metrics.runtime_metrics().map_or_else(
|
let out = self.services.server.metrics.runtime_metrics().map_or_else(
|
||||||
|| "Runtime metrics are not available.".to_owned(),
|
|| "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))
|
Ok(RoomMessageEventContent::text_markdown(out))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue