Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(737)

Unified Diff: net/quic/congestion_control/rtt_stats.cc

Issue 406403002: Fix to QUIC's RttStats ExpireSmoothedMetrics where the mean deviation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Reno_congestion_control_71621257
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/congestion_control/rtt_stats.h ('k') | net/quic/congestion_control/rtt_stats_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/congestion_control/rtt_stats.cc
diff --git a/net/quic/congestion_control/rtt_stats.cc b/net/quic/congestion_control/rtt_stats.cc
index e70d2d9588496def6bdf2b726480188482a4a4d5..b03686d747e6621102e0dd7e11d125fdf261e528 100644
--- a/net/quic/congestion_control/rtt_stats.cc
+++ b/net/quic/congestion_control/rtt_stats.cc
@@ -4,6 +4,8 @@
#include "net/quic/congestion_control/rtt_stats.h"
+#include <complex> // std::abs
+
using std::max;
namespace net {
@@ -40,7 +42,10 @@ void RttStats::SampleNewRecentMinRtt(uint32 num_samples) {
}
void RttStats::ExpireSmoothedMetrics() {
- mean_deviation_ = max(mean_deviation_, latest_rtt_.Subtract(smoothed_rtt_));
+ mean_deviation_ =
+ max(mean_deviation_,
+ QuicTime::Delta::FromMicroseconds(
+ std::abs(smoothed_rtt_.Subtract(latest_rtt_).ToMicroseconds())));
smoothed_rtt_ = max(smoothed_rtt_, latest_rtt_);
}
« no previous file with comments | « net/quic/congestion_control/rtt_stats.h ('k') | net/quic/congestion_control/rtt_stats_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698