From baa7c362e20ee68abcd4e1722b866ce3465b358d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Mon, 16 Sep 2024 16:30:35 -0300 Subject: [PATCH] src: stats: Add hub stats pub interface --- src/stats/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/stats/mod.rs b/src/stats/mod.rs index 114c3a4b..8cf352c7 100644 --- a/src/stats/mod.rs +++ b/src/stats/mod.rs @@ -60,6 +60,16 @@ impl Stats { response_rx.await? } + pub async fn hub_stats(&mut self) -> Result { + let (response_tx, response_rx) = oneshot::channel(); + self.sender + .send(StatsCommand::GetHubStats { + response: response_tx, + }) + .await?; + response_rx.await? + } + pub async fn set_period(&mut self, period: tokio::time::Duration) -> Result<()> { let (response_tx, response_rx) = oneshot::channel(); self.sender