diff --git a/src/hub/actor.rs b/src/hub/actor.rs index ad64a09e..9168cc1b 100644 --- a/src/hub/actor.rs +++ b/src/hub/actor.rs @@ -54,6 +54,10 @@ impl HubActor { let hub_stats = self.get_hub_stats().await; let _ = response.send(hub_stats); } + HubCommand::GetHubMessagesStats { response } => { + let hub_messages_stats = self.get_hub_messages_stats().await; + let _ = response.send(hub_messages_stats); + } HubCommand::ResetAllStats { response } => { let _ = response.send(self.reset_all_stats().await); } diff --git a/src/hub/protocol.rs b/src/hub/protocol.rs index 3c96dd79..3a30da60 100644 --- a/src/hub/protocol.rs +++ b/src/hub/protocol.rs @@ -6,7 +6,10 @@ use tokio::sync::{broadcast, oneshot}; use crate::{ drivers::{Driver, DriverInfo}, protocol::Protocol, - stats::accumulated::{driver::AccumulatedDriverStats, AccumulatedStatsInner}, + stats::accumulated::{ + driver::AccumulatedDriverStats, messages::AccumulatedHubMessagesStats, + AccumulatedStatsInner, + }, }; pub enum HubCommand { @@ -27,6 +30,9 @@ pub enum HubCommand { GetHubStats { response: oneshot::Sender, }, + GetHubMessagesStats { + response: oneshot::Sender, + }, GetDriversStats { response: oneshot::Sender>, },