Skip to content

Commit 5ddd3e5

Browse files
committed
Rename CongestionMetrics to reflect the associated qlog structure
1 parent 64e5711 commit 5ddd3e5

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

quinn-proto/src/connection/paths.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub(super) struct PathData {
4848

4949
/// Snapshot of the qlog recovery metrics
5050
#[cfg(feature = "qlog")]
51-
congestion_metrics: CongestionMetrics,
51+
recovery_metrics: RecoveryMetrics,
5252
}
5353

5454
impl PathData {
@@ -98,7 +98,7 @@ impl PathData {
9898
in_flight: InFlight::new(),
9999
first_packet: None,
100100
#[cfg(feature = "qlog")]
101-
congestion_metrics: CongestionMetrics::default(),
101+
recovery_metrics: RecoveryMetrics::default(),
102102
}
103103
}
104104

@@ -121,7 +121,7 @@ impl PathData {
121121
in_flight: InFlight::new(),
122122
first_packet: None,
123123
#[cfg(feature = "qlog")]
124-
congestion_metrics: prev.congestion_metrics.clone(),
124+
recovery_metrics: prev.recovery_metrics.clone(),
125125
}
126126
}
127127

@@ -168,10 +168,10 @@ impl PathData {
168168
}
169169

170170
#[cfg(feature = "qlog")]
171-
pub(super) fn qlog_congestion_metrics(&mut self, pto_count: u32) -> Option<MetricsUpdated> {
171+
pub(super) fn qlog_recovery_metrics(&mut self, pto_count: u32) -> Option<MetricsUpdated> {
172172
let controller_metrics = self.congestion.metrics();
173173

174-
let metrics = CongestionMetrics {
174+
let metrics = RecoveryMetrics {
175175
min_rtt: Some(self.rtt.min),
176176
smoothed_rtt: Some(self.rtt.get()),
177177
latest_rtt: Some(self.rtt.latest),
@@ -185,8 +185,8 @@ impl PathData {
185185
pacing_rate: controller_metrics.pacing_rate,
186186
};
187187

188-
let event = metrics.to_qlog_event(&self.congestion_metrics);
189-
self.congestion_metrics = metrics;
188+
let event = metrics.to_qlog_event(&self.recovery_metrics);
189+
self.recovery_metrics = metrics;
190190
event
191191
}
192192
}
@@ -197,7 +197,7 @@ impl PathData {
197197
#[cfg(feature = "qlog")]
198198
#[derive(Default, Clone, PartialEq)]
199199
#[non_exhaustive]
200-
struct CongestionMetrics {
200+
struct RecoveryMetrics {
201201
pub min_rtt: Option<Duration>,
202202
pub smoothed_rtt: Option<Duration>,
203203
pub latest_rtt: Option<Duration>,
@@ -211,7 +211,7 @@ struct CongestionMetrics {
211211
}
212212

213213
#[cfg(feature = "qlog")]
214-
impl CongestionMetrics {
214+
impl RecoveryMetrics {
215215
/// Retain only values that have been updated since the last snapshot.
216216
fn retain_updated(&self, previous: &Self) -> Self {
217217
macro_rules! keep_if_changed {

quinn-proto/src/connection/qlog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl QlogSink {
7272
return;
7373
};
7474

75-
let Some(metrics) = path.qlog_congestion_metrics(pto_count) else {
75+
let Some(metrics) = path.qlog_recovery_metrics(pto_count) else {
7676
return;
7777
};
7878

0 commit comments

Comments
 (0)