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

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

Issue 188333003: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compilation error - added NET_EXPORT_PRIVATE to QuicFixedUint32 Created 6 years, 9 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 | « net/quic/congestion_control/pacing_sender.cc ('k') | 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
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 //
5 // A convenience class to store rtt samples and calculate smoothed rtt.
6
7 #ifndef NET_QUIC_CONGESTION_CONTROL_RTT_STATS_H_
8 #define NET_QUIC_CONGESTION_CONTROL_RTT_STATS_H_
9
10 #include <algorithm>
11
12 #include "base/basictypes.h"
13 #include "net/quic/quic_protocol.h"
14 #include "net/quic/quic_time.h"
15
16 namespace net {
17
18 class NET_EXPORT_PRIVATE RttStats {
19 public:
20 RttStats();
21
22 // Returns true if any RTT measurements have been made.
23 bool HasUpdates() const;
24
25 // Updates the RTT from an incoming ack which is received |send_delta| after
26 // the packet is sent and the peer reports the ack being delayed |ack_delay|.
27 void UpdateRtt(QuicTime::Delta send_delta, QuicTime::Delta ack_delay);
28
29 QuicTime::Delta SmoothedRtt() const;
30
31 // Sets an initial RTT to be used for SmoothedRtt before any RTT updates.
32 void set_initial_rtt_us(int64 initial_rtt_us) {
33 initial_rtt_us_ = initial_rtt_us;
34 }
35
36 QuicTime::Delta latest_rtt() const {
37 return latest_rtt_;
38 }
39
40 QuicTime::Delta min_rtt() const {
41 return min_rtt_;
42 }
43
44 QuicTime::Delta mean_deviation() const {
45 return mean_deviation_;
46 }
47
48 private:
49 QuicTime::Delta latest_rtt_;
50 QuicTime::Delta min_rtt_;
51 QuicTime::Delta smoothed_rtt_;
52 // Mean RTT deviation during this session.
53 // Approximation of standard deviation, the error is roughly 1.25 times
54 // larger than the standard deviation, for a normally distributed signal.
55 QuicTime::Delta mean_deviation_;
56 int64 initial_rtt_us_;
57 };
58
59 } // namespace net
60
61 #endif // NET_QUIC_CONGESTION_CONTROL_RTT_STATS_H_
OLDNEW
« no previous file with comments | « net/quic/congestion_control/pacing_sender.cc ('k') | net/quic/congestion_control/rtt_stats.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698