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

Side by Side Diff: net/quic/congestion_control/rtt_stats.cc

Issue 394023005: Enable Kathleen Nichols min rtt algorithm with a 1 minute window in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | net/quic/quic_sent_packet_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/congestion_control/rtt_stats.h" 5 #include "net/quic/congestion_control/rtt_stats.h"
6 6
7 using std::max; 7 using std::max;
8 8
9 namespace net { 9 namespace net {
10 10
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 if (!HasUpdates()) { 76 if (!HasUpdates()) {
77 smoothed_rtt_ = rtt_sample; 77 smoothed_rtt_ = rtt_sample;
78 mean_deviation_ = QuicTime::Delta::FromMicroseconds( 78 mean_deviation_ = QuicTime::Delta::FromMicroseconds(
79 rtt_sample.ToMicroseconds() / 2); 79 rtt_sample.ToMicroseconds() / 2);
80 } else { 80 } else {
81 mean_deviation_ = QuicTime::Delta::FromMicroseconds( 81 mean_deviation_ = QuicTime::Delta::FromMicroseconds(
82 kOneMinusBeta * mean_deviation_.ToMicroseconds() + 82 kOneMinusBeta * mean_deviation_.ToMicroseconds() +
83 kBeta * std::abs(smoothed_rtt_.Subtract(rtt_sample).ToMicroseconds())); 83 kBeta * std::abs(smoothed_rtt_.Subtract(rtt_sample).ToMicroseconds()));
84 smoothed_rtt_ = smoothed_rtt_.Multiply(kOneMinusAlpha).Add( 84 smoothed_rtt_ = smoothed_rtt_.Multiply(kOneMinusAlpha).Add(
85 rtt_sample.Multiply(kAlpha)); 85 rtt_sample.Multiply(kAlpha));
86 DVLOG(1) << "Cubic; smoothed_rtt(us):" << smoothed_rtt_.ToMicroseconds() 86 DVLOG(1) << " smoothed_rtt(us):" << smoothed_rtt_.ToMicroseconds()
87 << " mean_deviation(us):" << mean_deviation_.ToMicroseconds(); 87 << " mean_deviation(us):" << mean_deviation_.ToMicroseconds();
88 } 88 }
89 } 89 }
90 90
91 void RttStats::UpdateRecentMinRtt(QuicTime::Delta rtt_sample, QuicTime now) { 91 void RttStats::UpdateRecentMinRtt(QuicTime::Delta rtt_sample, QuicTime now) {
92 // Recent min_rtt update. 92 // Recent min_rtt update.
93 if (num_min_rtt_samples_remaining_ > 0) { 93 if (num_min_rtt_samples_remaining_ > 0) {
94 --num_min_rtt_samples_remaining_; 94 --num_min_rtt_samples_remaining_;
95 if (new_min_rtt_.rtt.IsZero() || rtt_sample <= new_min_rtt_.rtt) { 95 if (new_min_rtt_.rtt.IsZero() || rtt_sample <= new_min_rtt_.rtt) {
96 new_min_rtt_ = RttSample(rtt_sample, now); 96 new_min_rtt_ = RttSample(rtt_sample, now);
(...skipping 30 matching lines...) Expand all
127 } 127 }
128 128
129 QuicTime::Delta RttStats::SmoothedRtt() const { 129 QuicTime::Delta RttStats::SmoothedRtt() const {
130 if (!HasUpdates()) { 130 if (!HasUpdates()) {
131 return QuicTime::Delta::FromMicroseconds(initial_rtt_us_); 131 return QuicTime::Delta::FromMicroseconds(initial_rtt_us_);
132 } 132 }
133 return smoothed_rtt_; 133 return smoothed_rtt_;
134 } 134 }
135 135
136 } // namespace net 136 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_sent_packet_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698