@@ -16,14 +16,7 @@ use ::qlog::events::{quic::CongestionStateUpdated, EventData};
1616use neqo_common:: { const_max, const_min, qdebug, qinfo, qlog:: Qlog , qtrace} ;
1717
1818use super :: CongestionControl ;
19- use crate :: {
20- packet,
21- qlog:: { self , QlogMetric } ,
22- recovery:: sent,
23- rtt:: RttEstimate ,
24- sender:: PACING_BURST_SIZE ,
25- Pmtud ,
26- } ;
19+ use crate :: { packet, qlog, recovery:: sent, rtt:: RttEstimate , sender:: PACING_BURST_SIZE , Pmtud } ;
2720
2821pub const CWND_INITIAL_PKTS : usize = 10 ;
2922const PERSISTENT_CONG_THRESH : u32 = 3 ;
@@ -210,7 +203,7 @@ impl<T: WindowAdjustment> CongestionControl for ClassicCongestionControl<T> {
210203
211204 if self . state . in_recovery ( ) {
212205 self . set_state ( State :: CongestionAvoidance , now) ;
213- qlog:: metrics_updated ( & self . qlog , & [ QlogMetric :: InRecovery ( false ) ] , now) ;
206+ qlog:: metrics_updated ( & self . qlog , & [ qlog :: Metric :: InRecovery ( false ) ] , now) ;
214207 }
215208
216209 new_acked += pkt. len ( ) ;
@@ -266,8 +259,8 @@ impl<T: WindowAdjustment> CongestionControl for ClassicCongestionControl<T> {
266259 qlog:: metrics_updated (
267260 & self . qlog ,
268261 & [
269- QlogMetric :: CongestionWindow ( self . congestion_window ) ,
270- QlogMetric :: BytesInFlight ( self . bytes_in_flight ) ,
262+ qlog :: Metric :: CongestionWindow ( self . congestion_window ) ,
263+ qlog :: Metric :: BytesInFlight ( self . bytes_in_flight ) ,
271264 ] ,
272265 now,
273266 ) ;
@@ -299,7 +292,7 @@ impl<T: WindowAdjustment> CongestionControl for ClassicCongestionControl<T> {
299292 }
300293 qlog:: metrics_updated (
301294 & self . qlog ,
302- & [ QlogMetric :: BytesInFlight ( self . bytes_in_flight ) ] ,
295+ & [ qlog :: Metric :: BytesInFlight ( self . bytes_in_flight ) ] ,
303296 now,
304297 ) ;
305298
@@ -346,7 +339,7 @@ impl<T: WindowAdjustment> CongestionControl for ClassicCongestionControl<T> {
346339 self . bytes_in_flight -= pkt. len ( ) ;
347340 qlog:: metrics_updated (
348341 & self . qlog ,
349- & [ QlogMetric :: BytesInFlight ( self . bytes_in_flight ) ] ,
342+ & [ qlog :: Metric :: BytesInFlight ( self . bytes_in_flight ) ] ,
350343 now,
351344 ) ;
352345 qtrace ! ( "[{self}] Ignore pkt with size {}" , pkt. len( ) ) ;
@@ -357,7 +350,7 @@ impl<T: WindowAdjustment> CongestionControl for ClassicCongestionControl<T> {
357350 self . bytes_in_flight = 0 ;
358351 qlog:: metrics_updated (
359352 & self . qlog ,
360- & [ QlogMetric :: BytesInFlight ( self . bytes_in_flight ) ] ,
353+ & [ qlog :: Metric :: BytesInFlight ( self . bytes_in_flight ) ] ,
361354 now,
362355 ) ;
363356 }
@@ -388,7 +381,7 @@ impl<T: WindowAdjustment> CongestionControl for ClassicCongestionControl<T> {
388381 ) ;
389382 qlog:: metrics_updated (
390383 & self . qlog ,
391- & [ QlogMetric :: BytesInFlight ( self . bytes_in_flight ) ] ,
384+ & [ qlog :: Metric :: BytesInFlight ( self . bytes_in_flight ) ] ,
392385 now,
393386 ) ;
394387 }
@@ -520,7 +513,7 @@ impl<T: WindowAdjustment> ClassicCongestionControl<T> {
520513 self . set_state ( State :: PersistentCongestion , now) ;
521514 qlog:: metrics_updated (
522515 & self . qlog ,
523- & [ QlogMetric :: CongestionWindow ( self . congestion_window ) ] ,
516+ & [ qlog :: Metric :: CongestionWindow ( self . congestion_window ) ] ,
524517 now,
525518 ) ;
526519 return true ;
@@ -568,9 +561,9 @@ impl<T: WindowAdjustment> ClassicCongestionControl<T> {
568561 qlog:: metrics_updated (
569562 & self . qlog ,
570563 & [
571- QlogMetric :: CongestionWindow ( self . congestion_window ) ,
572- QlogMetric :: SsThresh ( self . ssthresh ) ,
573- QlogMetric :: InRecovery ( true ) ,
564+ qlog :: Metric :: CongestionWindow ( self . congestion_window ) ,
565+ qlog :: Metric :: SsThresh ( self . ssthresh ) ,
566+ qlog :: Metric :: InRecovery ( true ) ,
574567 ] ,
575568 now,
576569 ) ;
0 commit comments