OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef NET_BASE_BANDWIDTH_METRICS_H_ | 5 #ifndef NET_BASE_BANDWIDTH_METRICS_H_ |
6 #define NET_BASE_BANDWIDTH_METRICS_H_ | 6 #define NET_BASE_BANDWIDTH_METRICS_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
| 10 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
11 #include "base/logging.h" | 12 #include "base/time/time.h" |
12 #include "base/time.h" | |
13 | 13 |
14 namespace net { | 14 namespace net { |
15 | 15 |
16 // Tracks statistics about the bandwidth metrics over time. In order to | 16 // Tracks statistics about the bandwidth metrics over time. In order to |
17 // measure, this class needs to know when individual streams are in progress, | 17 // measure, this class needs to know when individual streams are in progress, |
18 // so that it can know when to discount idle time. The BandwidthMetrics | 18 // so that it can know when to discount idle time. The BandwidthMetrics |
19 // is unidirectional - it should only be used to record upload or download | 19 // is unidirectional - it should only be used to record upload or download |
20 // bandwidth, but not both. | 20 // bandwidth, but not both. |
21 // | 21 // |
22 // Note, the easiest thing to do is to just measure each stream and average | 22 // Note, the easiest thing to do is to just measure each stream and average |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 void StopStream(); | 127 void StopStream(); |
128 void RecordBytes(int bytes); | 128 void RecordBytes(int bytes); |
129 | 129 |
130 private: | 130 private: |
131 bool started_; | 131 bool started_; |
132 }; | 132 }; |
133 | 133 |
134 } // namespace net | 134 } // namespace net |
135 | 135 |
136 #endif // NET_BASE_BANDWIDTH_METRICS_H_ | 136 #endif // NET_BASE_BANDWIDTH_METRICS_H_ |
OLD | NEW |