Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Correct num_packets stats
Browse files Browse the repository at this point in the history
  • Loading branch information
lijunwangs committed Oct 10, 2023
1 parent 253bf0b commit d51d7fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion quic-client/src/nonblocking/quic_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,13 +582,14 @@ impl ClientConnection for QuicClientConnection {

async fn send_data(&self, data: &[u8]) -> TransportResult<()> {
let stats = Arc::new(ClientStats::default());
// When data is empty which is from cache warmer, we are not sending packets actually, do not count it in stats.
// When data is empty which is from cache warmer, we are not sending packets actually, do not count it in
let num_packets = if data.is_empty() { 0 } else { 1 };
self.client
.send_buffer(data, &stats, self.connection_stats.clone())
.map_ok(|v| {
self.connection_stats
.add_client_stats(&stats, num_packets, true);
v
})
.map_err(|e| {
warn!(
Expand Down

0 comments on commit d51d7fa

Please sign in to comment.