| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/nqe/network_quality_estimator.h" | 5 #include "net/nqe/network_quality_estimator.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 histogram_name, 1, 1000 * 1000 /* 1 Gbps */, 50 /* Number of buckets */, | 184 histogram_name, 1, 1000 * 1000 /* 1 Gbps */, 50 /* Number of buckets */, |
| 185 base::HistogramBase::kUmaTargetedHistogramFlag); | 185 base::HistogramBase::kUmaTargetedHistogramFlag); |
| 186 histogram->Add(std::abs(metric)); | 186 histogram->Add(std::abs(metric)); |
| 187 } | 187 } |
| 188 | 188 |
| 189 void RecordEffectiveConnectionTypeAccuracy( | 189 void RecordEffectiveConnectionTypeAccuracy( |
| 190 const char* prefix, | 190 const char* prefix, |
| 191 int32_t metric, | 191 int32_t metric, |
| 192 base::TimeDelta measuring_duration, | 192 base::TimeDelta measuring_duration, |
| 193 EffectiveConnectionType observed_effective_connection_type) { | 193 EffectiveConnectionType observed_effective_connection_type) { |
| 194 const std::string histogram_name = base::StringPrintf( | 194 const std::string histogram_name = |
| 195 "%s.EstimatedObservedDiff.%s.%d.%s", prefix, | 195 base::StringPrintf("%s.EstimatedObservedDiff.%s.%d.%s", prefix, |
| 196 metric >= 0 ? "Positive" : "Negative", | 196 metric >= 0 ? "Positive" : "Negative", |
| 197 static_cast<int32_t>(measuring_duration.InSeconds()), | 197 static_cast<int32_t>(measuring_duration.InSeconds()), |
| 198 GetNameForEffectiveConnectionType(observed_effective_connection_type)); | 198 DeprecatedGetNameForEffectiveConnectionType( |
| 199 observed_effective_connection_type)); |
| 199 | 200 |
| 200 base::HistogramBase* histogram = base::Histogram::FactoryGet( | 201 base::HistogramBase* histogram = base::Histogram::FactoryGet( |
| 201 histogram_name, 0, EFFECTIVE_CONNECTION_TYPE_LAST, | 202 histogram_name, 0, EFFECTIVE_CONNECTION_TYPE_LAST, |
| 202 EFFECTIVE_CONNECTION_TYPE_LAST /* Number of buckets */, | 203 EFFECTIVE_CONNECTION_TYPE_LAST /* Number of buckets */, |
| 203 base::HistogramBase::kUmaTargetedHistogramFlag); | 204 base::HistogramBase::kUmaTargetedHistogramFlag); |
| 204 histogram->Add(std::abs(metric)); | 205 histogram->Add(std::abs(metric)); |
| 205 } | 206 } |
| 206 | 207 |
| 207 } // namespace | 208 } // namespace |
| 208 | 209 |
| (...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1724 NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_CACHED_ESTIMATE); | 1725 NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_CACHED_ESTIMATE); |
| 1725 downstream_throughput_kbps_observations_.AddObservation( | 1726 downstream_throughput_kbps_observations_.AddObservation( |
| 1726 throughput_observation); | 1727 throughput_observation); |
| 1727 NotifyObserversOfThroughput(throughput_observation); | 1728 NotifyObserversOfThroughput(throughput_observation); |
| 1728 } | 1729 } |
| 1729 | 1730 |
| 1730 ComputeEffectiveConnectionType(); | 1731 ComputeEffectiveConnectionType(); |
| 1731 } | 1732 } |
| 1732 | 1733 |
| 1733 } // namespace net | 1734 } // namespace net |
| OLD | NEW |