@@ -2098,7 +2098,6 @@ bool QuicSession::Receive(
20982098 UpdateIdleTimer ();
20992099
21002100 SendPendingData ();
2101- UpdateRecoveryStats ();
21022101 Debug (this , " Successfully processed received packet" );
21032102 return true ;
21042103}
@@ -2893,19 +2892,6 @@ void QuicSessionOnCertDone(const FunctionCallbackInfo<Value>& args) {
28932892}
28942893} // namespace
28952894
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- }
29092895
29102896// Data stats are used to allow user code to keep track of important
29112897// statistics such as amount of data in flight through the lifetime
@@ -2918,6 +2904,13 @@ void QuicSession::UpdateDataStats() {
29182904 ngtcp2_conn_stat stat;
29192905 ngtcp2_conn_get_conn_stat (connection (), &stat);
29202906
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+
29212914 state_->bytes_in_flight = stat.bytes_in_flight ;
29222915 // The max_bytes_in_flight is a highwater mark that can be used
29232916 // in performance analysis operations.
0 commit comments