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

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

Issue 352403002: Repair the CWND reduction caused by spurious RTO's in QUIC's congestion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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.cc ('k') | net/quic/congestion_control/send_algorithm_interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/congestion_control/rtt_stats_test.cc
diff --git a/net/quic/congestion_control/rtt_stats_test.cc b/net/quic/congestion_control/rtt_stats_test.cc
index f1c0fc1ce981df663ccfa6f453b17045788b1a1f..a24016cc49b7cd24660d2aa40c7e4bb76325e85d 100644
--- a/net/quic/congestion_control/rtt_stats_test.cc
+++ b/net/quic/congestion_control/rtt_stats_test.cc
@@ -154,7 +154,25 @@ TEST_F(RttStatsTest, WindowedRecentMinRtt) {
EXPECT_EQ(rtt_sample, rtt_stats_.recent_min_rtt());
}
-
+TEST_F(RttStatsTest, ExpireSmoothedMetrics) {
+ QuicTime::Delta initial_rtt = QuicTime::Delta::FromMilliseconds(10);
+ rtt_stats_.UpdateRtt(initial_rtt, QuicTime::Delta::Zero(), QuicTime::Zero());
+ EXPECT_EQ(initial_rtt, rtt_stats_.min_rtt());
+ EXPECT_EQ(initial_rtt, rtt_stats_.recent_min_rtt());
+ EXPECT_EQ(initial_rtt, rtt_stats_.SmoothedRtt());
+
+ EXPECT_EQ(initial_rtt.Multiply(0.5), rtt_stats_.mean_deviation());
+
+ // Update once with a 20ms RTT.
+ QuicTime::Delta doubled_rtt = initial_rtt.Multiply(2);
+ rtt_stats_.UpdateRtt(doubled_rtt, QuicTime::Delta::Zero(), QuicTime::Zero());
+ EXPECT_EQ(initial_rtt.Multiply(1.125), rtt_stats_.SmoothedRtt());
+
+ // Expire the smoothed metrics, increasing smoothed rtt and mean deviation.
+ rtt_stats_.ExpireSmoothedMetrics();
+ EXPECT_EQ(doubled_rtt, rtt_stats_.SmoothedRtt());
+ EXPECT_EQ(initial_rtt.Multiply(0.875), rtt_stats_.mean_deviation());
+}
} // namespace test
} // namespace net
« no previous file with comments | « net/quic/congestion_control/rtt_stats.cc ('k') | net/quic/congestion_control/send_algorithm_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698