Chromium Code Reviews| Index: net/base/bandwidth_metrics.h |
| diff --git a/net/base/bandwidth_metrics.h b/net/base/bandwidth_metrics.h |
| index e5f2646c7dc71ad5b0a96e1f5d94eaa0ab5fb56a..b3bee53fe18eb00ec0d6905668f8df809e9a89cc 100644 |
| --- a/net/base/bandwidth_metrics.h |
| +++ b/net/base/bandwidth_metrics.h |
| @@ -57,13 +57,10 @@ class BandwidthMetrics { |
| : num_streams_in_progress_(0), |
| num_data_samples_(0), |
| data_sum_(0.0), |
| - bytes_since_last_start_(0) { |
| - } |
| + bytes_since_last_start_(0) {} |
| // Get the bandwidth. Returns Kbps (kilo-bits-per-second). |
| - double bandwidth() const { |
| - return data_sum_ / num_data_samples_; |
| - } |
| + double bandwidth() const { return data_sum_ / num_data_samples_; } |
| // Record that we've started a stream. |
| void StartStream() { |
| @@ -92,8 +89,8 @@ class BandwidthMetrics { |
| double kbps = static_cast<double>(bytes_since_last_start_) * 8 / ms; |
| ++num_data_samples_; |
| data_sum_ += kbps; |
| - VLOG(1) << "Bandwidth: " << kbps |
| - << "Kbps (avg " << bandwidth() << "Kbps)"; |
| + VLOG(1) << "Bandwidth: " << kbps << "Kbps (avg " << bandwidth() |
| + << "Kbps)"; |
|
davidben
2014/10/10 20:24:15
No action: I feel like the old one is slightly bet
|
| int kbps_int = static_cast<int>(kbps); |
| UMA_HISTOGRAM_COUNTS_10000("Net.DownloadBandwidth", kbps_int); |
| } |
| @@ -107,7 +104,7 @@ class BandwidthMetrics { |
| } |
| private: |
| - int num_streams_in_progress_; // The number of streams in progress. |
| + int num_streams_in_progress_; // The number of streams in progress. |
| // TODO(mbelshe): Use a rolling buffer of 30 samples instead of an average. |
| int num_data_samples_; // The number of samples collected. |
| double data_sum_; // The sum of all samples collected. |