Skip to content

Commit ac8d049

Browse files
committed
clean up comments
1 parent dca4c1d commit ac8d049

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/datadog-trace-agent/src/stats_flusher.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,16 @@ impl StatsFlusher for ServerlessStatsFlusher {
6161
}
6262
});
6363

64-
// flush stats from the bufferon a fixed interval
64+
// flush stats from the buffer on a fixed interval
6565
loop {
6666
tokio::time::sleep(time::Duration::from_secs(config.stats_flush_interval_secs)).await;
6767

6868
let mut buffer = buffer_consumer.lock().await;
69+
// copy the batch for this flush
6970
let channel_stats = buffer.to_vec();
71+
// reset the buffer so the next tick only sees new stats
7072
buffer.clear();
73+
// release the mutex before flushing stats
7174
drop(buffer);
7275

7376
let should_flush = should_flush_stats_buffer(

0 commit comments

Comments
 (0)