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

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

Issue 665883003: Demoting a warning message to DLOG(INFO) due to high frequency. Will (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Fixes_two_div_by_zero_bugs_78017204
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | no next file » | 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 #include <complex> // std::abs 7 #include <complex> // std::abs
8 8
9 using std::max; 9 using std::max;
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 if (send_delta > ack_delay) { 57 if (send_delta > ack_delay) {
58 rtt_sample = send_delta.Subtract(ack_delay); 58 rtt_sample = send_delta.Subtract(ack_delay);
59 } else if (!HasUpdates()) { 59 } else if (!HasUpdates()) {
60 // Even though we received information from the peer suggesting 60 // Even though we received information from the peer suggesting
61 // an invalid (negative) RTT, we can use the send delta as an 61 // an invalid (negative) RTT, we can use the send delta as an
62 // approximation until we get a better estimate. 62 // approximation until we get a better estimate.
63 rtt_sample = send_delta; 63 rtt_sample = send_delta;
64 } 64 }
65 65
66 if (rtt_sample.IsInfinite() || rtt_sample.IsZero()) { 66 if (rtt_sample.IsInfinite() || rtt_sample.IsZero()) {
67 LOG(WARNING) << "Ignoring rtt, because it's " 67 DVLOG(1) << "Ignoring rtt, because it's "
68 << (rtt_sample.IsZero() ? "Zero" : "Infinite"); 68 << (rtt_sample.IsZero() ? "Zero" : "Infinite");
69 return; 69 return;
70 } 70 }
71 // RTT can't be non-positive. 71 // RTT can't be non-positive.
72 DCHECK_LT(0, rtt_sample.ToMicroseconds()); 72 DCHECK_LT(0, rtt_sample.ToMicroseconds());
73 73
74 latest_rtt_ = rtt_sample; 74 latest_rtt_ = rtt_sample;
75 // First time call or link delay decreases. 75 // First time call or link delay decreases.
76 if (min_rtt_.IsZero() || min_rtt_ > rtt_sample) { 76 if (min_rtt_.IsZero() || min_rtt_ > rtt_sample) {
77 min_rtt_ = rtt_sample; 77 min_rtt_ = rtt_sample;
78 } 78 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 139 }
140 140
141 QuicTime::Delta RttStats::MinRtt() const { 141 QuicTime::Delta RttStats::MinRtt() const {
142 if (!HasUpdates()) { 142 if (!HasUpdates()) {
143 return QuicTime::Delta::FromMicroseconds(initial_rtt_us_); 143 return QuicTime::Delta::FromMicroseconds(initial_rtt_us_);
144 } 144 }
145 return min_rtt_; 145 return min_rtt_;
146 } 146 }
147 147
148 } // namespace net 148 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698