Flush stats (#38)

* flush stats

* stats

* refactor
This commit is contained in:
Lev Kokotov
2022-02-22 18:10:30 -08:00
committed by GitHub
parent 3f16123cc5
commit af1716bcd7
3 changed files with 128 additions and 109 deletions

View File

@@ -111,9 +111,9 @@ async fn main() {
// Collect statistics and send them to StatsD
let (tx, rx) = mpsc::channel(100);
let collector_tx = tx.clone();
tokio::task::spawn(async move {
let mut stats_collector = Collector::new(rx);
let mut stats_collector = Collector::new(rx, collector_tx);
stats_collector.collect().await;
});