Skip to content

Commit

Permalink
src: stats: Add hub stats to the protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoantoniocardoso committed Sep 16, 2024
1 parent 9f41887 commit 928410e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/stats/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ impl StatsActor {
let result = self.drivers_stats().await;
let _ = response.send(result);
}
StatsCommand::GetHubStats { response } => {
let result = self.hub_stats().await;
let _ = response.send(result);
}
}
}

Expand Down
5 changes: 4 additions & 1 deletion src/stats/protocol.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::Result;
use tokio::sync::oneshot;

use crate::stats::DriversStats;
use crate::stats::{DriversStats, StatsInner};

pub enum StatsCommand {
SetPeriod {
Expand All @@ -14,4 +14,7 @@ pub enum StatsCommand {
GetDriversStats {
response: oneshot::Sender<Result<DriversStats>>,
},
GetHubStats {
response: oneshot::Sender<Result<StatsInner>>,
},
}

0 comments on commit 928410e

Please sign in to comment.