From 3b6c5c051e3824732ce3d0fc826050dd2500971e Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 27 Apr 2022 16:51:21 -0700 Subject: [PATCH] Swap quic counters with 0 while reporting (#24754) (#24758) (cherry picked from commit ded6ac669628929b53168331da30f6af0bdf9f63) Co-authored-by: Pankaj Garg --- streamer/src/quic.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/streamer/src/quic.rs b/streamer/src/quic.rs index fb2ebca1a9932a..c7615c2bd2ff59 100644 --- a/streamer/src/quic.rs +++ b/streamer/src/quic.rs @@ -373,52 +373,52 @@ impl StreamStats { ), ( "connection_add_failed", - self.connection_add_failed.load(Ordering::Relaxed), + self.connection_add_failed.swap(0, Ordering::Relaxed), i64 ), ( "connection_setup_timeout", - self.connection_setup_timeout.load(Ordering::Relaxed), + self.connection_setup_timeout.swap(0, Ordering::Relaxed), i64 ), ( "invalid_chunk", - self.total_invalid_chunks.load(Ordering::Relaxed), + self.total_invalid_chunks.swap(0, Ordering::Relaxed), i64 ), ( "invalid_chunk_size", - self.total_invalid_chunk_size.load(Ordering::Relaxed), + self.total_invalid_chunk_size.swap(0, Ordering::Relaxed), i64 ), ( "packets_allocated", - self.total_packets_allocated.load(Ordering::Relaxed), + self.total_packets_allocated.swap(0, Ordering::Relaxed), i64 ), ( "chunks_received", - self.total_chunks_received.load(Ordering::Relaxed), + self.total_chunks_received.swap(0, Ordering::Relaxed), i64 ), ( "packet_batch_send_error", - self.total_packet_batch_send_err.load(Ordering::Relaxed), + self.total_packet_batch_send_err.swap(0, Ordering::Relaxed), i64 ), ( "packet_batches_sent", - self.total_packet_batches_sent.load(Ordering::Relaxed), + self.total_packet_batches_sent.swap(0, Ordering::Relaxed), i64 ), ( "packet_batch_empty", - self.total_packet_batches_none.load(Ordering::Relaxed), + self.total_packet_batches_none.swap(0, Ordering::Relaxed), i64 ), ( "stream_read_errors", - self.total_stream_read_errors.load(Ordering::Relaxed), + self.total_stream_read_errors.swap(0, Ordering::Relaxed), i64 ), );