@@ -2098,7 +2098,6 @@ bool QuicSession::Receive(
2098
2098
UpdateIdleTimer ();
2099
2099
2100
2100
SendPendingData ();
2101
- UpdateRecoveryStats ();
2102
2101
Debug (this , " Successfully processed received packet" );
2103
2102
return true ;
2104
2103
}
@@ -2893,19 +2892,6 @@ void QuicSessionOnCertDone(const FunctionCallbackInfo<Value>& args) {
2893
2892
}
2894
2893
} // namespace
2895
2894
2896
- // Recovery stats are used to allow user code to keep track of
2897
- // important round-trip timing statistics that are updated through
2898
- // the lifetime of a connection. Effectively, these communicate how
2899
- // much time (from the perspective of the local peer) is being taken
2900
- // to exchange data reliably with the remote peer.
2901
- // TODO(@jasnell): Revisit
2902
- void QuicSession::UpdateRecoveryStats () {
2903
- ngtcp2_conn_stat stat;
2904
- ngtcp2_conn_get_conn_stat (connection (), &stat);
2905
- SetStat (&QuicSessionStats::min_rtt, stat.min_rtt );
2906
- SetStat (&QuicSessionStats::latest_rtt, stat.latest_rtt );
2907
- SetStat (&QuicSessionStats::smoothed_rtt, stat.smoothed_rtt );
2908
- }
2909
2895
2910
2896
// Data stats are used to allow user code to keep track of important
2911
2897
// statistics such as amount of data in flight through the lifetime
@@ -2918,6 +2904,13 @@ void QuicSession::UpdateDataStats() {
2918
2904
ngtcp2_conn_stat stat;
2919
2905
ngtcp2_conn_get_conn_stat (connection (), &stat);
2920
2906
2907
+ SetStat (&QuicSessionStats::latest_rtt, stat.latest_rtt );
2908
+ SetStat (&QuicSessionStats::min_rtt, stat.min_rtt );
2909
+ SetStat (&QuicSessionStats::smoothed_rtt, stat.smoothed_rtt );
2910
+ SetStat (&QuicSessionStats::receive_rate, stat.recv_rate_sec );
2911
+ SetStat (&QuicSessionStats::send_rate, stat.delivery_rate_sec );
2912
+ SetStat (&QuicSessionStats::cwnd, stat.cwnd );
2913
+
2921
2914
state_->bytes_in_flight = stat.bytes_in_flight ;
2922
2915
// The max_bytes_in_flight is a highwater mark that can be used
2923
2916
// in performance analysis operations.
0 commit comments