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

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

Issue 670533004: Fixes two div by zero bugs in QUIC's BBR pacing code that caused server (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Simplify_QuicUnackedPacketMap_77986449
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 | net/quic/congestion_control/rtt_stats.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 // A convenience class to store rtt samples and calculate smoothed rtt. 5 // A convenience class to store rtt samples and calculate smoothed rtt.
6 6
7 #ifndef NET_QUIC_CONGESTION_CONTROL_RTT_STATS_H_ 7 #ifndef NET_QUIC_CONGESTION_CONTROL_RTT_STATS_H_
8 #define NET_QUIC_CONGESTION_CONTROL_RTT_STATS_H_ 8 #define NET_QUIC_CONGESTION_CONTROL_RTT_STATS_H_
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 25 matching lines...) Expand all
36 // is larger. The mean deviation is increased to the most recent deviation if 36 // is larger. The mean deviation is increased to the most recent deviation if
37 // it's larger. 37 // it's larger.
38 void ExpireSmoothedMetrics(); 38 void ExpireSmoothedMetrics();
39 39
40 // Forces RttStats to sample a new recent min rtt within the next 40 // Forces RttStats to sample a new recent min rtt within the next
41 // |num_samples| UpdateRtt calls. 41 // |num_samples| UpdateRtt calls.
42 void SampleNewRecentMinRtt(uint32 num_samples); 42 void SampleNewRecentMinRtt(uint32 num_samples);
43 43
44 QuicTime::Delta SmoothedRtt() const; 44 QuicTime::Delta SmoothedRtt() const;
45 45
46 // Returns the min_rtt for the entire connection if a min has been measured.
47 // This returns an initial non-zero RTT estimate if no measurements have yet
48 // been made.
49 QuicTime::Delta MinRtt() const;
50
46 int64 initial_rtt_us() const { 51 int64 initial_rtt_us() const {
47 return initial_rtt_us_; 52 return initial_rtt_us_;
48 } 53 }
49 54
50 // Sets an initial RTT to be used for SmoothedRtt before any RTT updates. 55 // Sets an initial RTT to be used for SmoothedRtt before any RTT updates.
51 void set_initial_rtt_us(int64 initial_rtt_us) { 56 void set_initial_rtt_us(int64 initial_rtt_us) {
52 initial_rtt_us_ = initial_rtt_us; 57 initial_rtt_us_ = initial_rtt_us;
53 } 58 }
54 59
55 QuicTime::Delta latest_rtt() const { 60 QuicTime::Delta latest_rtt() const {
56 return latest_rtt_; 61 return latest_rtt_;
57 } 62 }
58 63
59 // Returns the min_rtt for the entire connection.
60 QuicTime::Delta min_rtt() const {
61 return min_rtt_;
62 }
63
64 // Returns the min_rtt since SampleNewRecentMinRtt has been called, or the 64 // Returns the min_rtt since SampleNewRecentMinRtt has been called, or the
65 // min_rtt for the entire connection if SampleNewMinRtt was never called. 65 // min_rtt for the entire connection if SampleNewMinRtt was never called.
66 QuicTime::Delta recent_min_rtt() const { 66 QuicTime::Delta recent_min_rtt() const {
67 return recent_min_rtt_.rtt; 67 return recent_min_rtt_.rtt;
68 } 68 }
69 69
70 QuicTime::Delta mean_deviation() const { 70 QuicTime::Delta mean_deviation() const {
71 return mean_deviation_; 71 return mean_deviation_;
72 } 72 }
73 73
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 RttSample recent_min_rtt_; // a in the windowed algorithm. 108 RttSample recent_min_rtt_; // a in the windowed algorithm.
109 RttSample half_window_rtt_; // b in the sampled algorithm. 109 RttSample half_window_rtt_; // b in the sampled algorithm.
110 RttSample quarter_window_rtt_; // c in the sampled algorithm. 110 RttSample quarter_window_rtt_; // c in the sampled algorithm.
111 111
112 DISALLOW_COPY_AND_ASSIGN(RttStats); 112 DISALLOW_COPY_AND_ASSIGN(RttStats);
113 }; 113 };
114 114
115 } // namespace net 115 } // namespace net
116 116
117 #endif // NET_QUIC_CONGESTION_CONTROL_RTT_STATS_H_ 117 #endif // NET_QUIC_CONGESTION_CONTROL_RTT_STATS_H_
OLDNEW
« no previous file with comments | « no previous file | net/quic/congestion_control/rtt_stats.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698