@@ -1408,6 +1408,12 @@ pub struct Connection {
1408
1408
/// Total number of packets sent with data retransmitted.
1409
1409
retrans_count: usize,
1410
1410
1411
+ /// Total number of sent DATAGRAM frames.
1412
+ dgram_sent_count: usize,
1413
+
1414
+ /// Total number of received DATAGRAM frames.
1415
+ dgram_recv_count: usize,
1416
+
1411
1417
/// Total number of bytes received from the peer.
1412
1418
rx_data: u64,
1413
1419
@@ -1903,6 +1909,8 @@ impl Connection {
1903
1909
sent_count: 0,
1904
1910
lost_count: 0,
1905
1911
retrans_count: 0,
1912
+ dgram_sent_count: 0,
1913
+ dgram_recv_count: 0,
1906
1914
sent_bytes: 0,
1907
1915
recv_bytes: 0,
1908
1916
acked_bytes: 0,
@@ -4306,6 +4314,10 @@ impl Connection {
4306
4314
ack_eliciting = true;
4307
4315
in_flight = true;
4308
4316
dgram_emitted = true;
4317
+ let _ =
4318
+ self.dgram_sent_count.saturating_add(1);
4319
+ let _ =
4320
+ path.dgram_sent_count.saturating_add(1);
4309
4321
}
4310
4322
},
4311
4323
@@ -6577,6 +6589,8 @@ impl Connection {
6577
6589
acked_bytes: self.acked_bytes,
6578
6590
lost_bytes: self.lost_bytes,
6579
6591
stream_retrans_bytes: self.stream_retrans_bytes,
6592
+ dgram_recv: self.dgram_recv_count,
6593
+ dgram_sent: self.dgram_sent_count,
6580
6594
paths_count: self.paths.len(),
6581
6595
reset_stream_count_local: self.reset_stream_local_count,
6582
6596
stopped_stream_count_local: self.stopped_stream_local_count,
@@ -7399,6 +7413,13 @@ impl Connection {
7399
7413
}
7400
7414
7401
7415
self.dgram_recv_queue.push(data)?;
7416
+
7417
+ let _ = self.dgram_recv_count.saturating_add(1);
7418
+ let _ = self
7419
+ .paths
7420
+ .get_mut(recv_path_id)?
7421
+ .dgram_recv_count
7422
+ .saturating_add(1);
7402
7423
},
7403
7424
7404
7425
frame::Frame::DatagramHeader { .. } => unreachable!(),
@@ -7946,6 +7967,12 @@ pub struct Stats {
7946
7967
/// The number of stream bytes retransmitted.
7947
7968
pub stream_retrans_bytes: u64,
7948
7969
7970
+ /// The number of DATAGRAM frames received.
7971
+ pub dgram_recv: usize,
7972
+
7973
+ /// The number of DATAGRAM frames sent.
7974
+ pub dgram_sent: usize,
7975
+
7949
7976
/// The number of known paths for the connection.
7950
7977
pub paths_count: usize,
7951
7978
0 commit comments