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

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

Issue 734063004: Update from https://crrev.com/304418 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
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 #include <complex> // std::abs 7 #include <complex> // std::abs
8 8
9 using std::max; 9 using std::max;
10 10
(...skipping 10 matching lines...) Expand all
21 const float kHalfWindow = 0.5f; 21 const float kHalfWindow = 0.5f;
22 const float kQuarterWindow = 0.25f; 22 const float kQuarterWindow = 0.25f;
23 23
24 } // namespace 24 } // namespace
25 25
26 RttStats::RttStats() 26 RttStats::RttStats()
27 : latest_rtt_(QuicTime::Delta::Zero()), 27 : latest_rtt_(QuicTime::Delta::Zero()),
28 min_rtt_(QuicTime::Delta::Zero()), 28 min_rtt_(QuicTime::Delta::Zero()),
29 smoothed_rtt_(QuicTime::Delta::Zero()), 29 smoothed_rtt_(QuicTime::Delta::Zero()),
30 mean_deviation_(QuicTime::Delta::Zero()), 30 mean_deviation_(QuicTime::Delta::Zero()),
31 initial_rtt_us_(kInitialRttMs * base::Time::kMicrosecondsPerMillisecond), 31 initial_rtt_us_(kInitialRttMs * kNumMicrosPerMilli),
32 num_min_rtt_samples_remaining_(0), 32 num_min_rtt_samples_remaining_(0),
33 recent_min_rtt_window_(QuicTime::Delta::Infinite()) {} 33 recent_min_rtt_window_(QuicTime::Delta::Infinite()) {}
34 34
35 void RttStats::SampleNewRecentMinRtt(uint32 num_samples) { 35 void RttStats::SampleNewRecentMinRtt(uint32 num_samples) {
36 num_min_rtt_samples_remaining_ = num_samples; 36 num_min_rtt_samples_remaining_ = num_samples;
37 new_min_rtt_ = RttSample(); 37 new_min_rtt_ = RttSample();
38 } 38 }
39 39
40 void RttStats::ExpireSmoothedMetrics() { 40 void RttStats::ExpireSmoothedMetrics() {
41 mean_deviation_ = 41 mean_deviation_ =
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 now.Subtract(recent_min_rtt_window_.Multiply(kHalfWindow))) { 121 now.Subtract(recent_min_rtt_window_.Multiply(kHalfWindow))) {
122 half_window_rtt_ = quarter_window_rtt_; 122 half_window_rtt_ = quarter_window_rtt_;
123 quarter_window_rtt_ = RttSample(rtt_sample, now); 123 quarter_window_rtt_ = RttSample(rtt_sample, now);
124 } else if (quarter_window_rtt_.time < 124 } else if (quarter_window_rtt_.time <
125 now.Subtract(recent_min_rtt_window_.Multiply(kQuarterWindow))) { 125 now.Subtract(recent_min_rtt_window_.Multiply(kQuarterWindow))) {
126 quarter_window_rtt_ = RttSample(rtt_sample, now); 126 quarter_window_rtt_ = RttSample(rtt_sample, now);
127 } 127 }
128 } 128 }
129 129
130 } // namespace net 130 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/pacing_sender.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