| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_params.h" | 5 #include "net/nqe/network_quality_estimator_params.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 225 |
| 226 void ObtainTypicalNetworkQuality(NetworkQuality typical_network_quality[]) { | 226 void ObtainTypicalNetworkQuality(NetworkQuality typical_network_quality[]) { |
| 227 for (size_t i = 0; i < EFFECTIVE_CONNECTION_TYPE_LAST; ++i) { | 227 for (size_t i = 0; i < EFFECTIVE_CONNECTION_TYPE_LAST; ++i) { |
| 228 DCHECK_EQ(InvalidRTT(), typical_network_quality[i].http_rtt()); | 228 DCHECK_EQ(InvalidRTT(), typical_network_quality[i].http_rtt()); |
| 229 DCHECK_EQ(InvalidRTT(), typical_network_quality[i].transport_rtt()); | 229 DCHECK_EQ(InvalidRTT(), typical_network_quality[i].transport_rtt()); |
| 230 DCHECK_EQ(kInvalidThroughput, | 230 DCHECK_EQ(kInvalidThroughput, |
| 231 typical_network_quality[i].downstream_throughput_kbps()); | 231 typical_network_quality[i].downstream_throughput_kbps()); |
| 232 } | 232 } |
| 233 | 233 |
| 234 typical_network_quality[EFFECTIVE_CONNECTION_TYPE_SLOW_2G] = NetworkQuality( | 234 typical_network_quality[EFFECTIVE_CONNECTION_TYPE_SLOW_2G] = NetworkQuality( |
| 235 // Set to the 83rd percentile of 2G RTT observations on Android. This | 235 // Set to the 77.5th percentile of 2G RTT observations on Android. This |
| 236 // corresponds to the median RTT observation when effective connection | 236 // corresponds to the median RTT observation when effective connection |
| 237 // type is Slow 2G. | 237 // type is Slow 2G. |
| 238 base::TimeDelta::FromMilliseconds(3600), | 238 base::TimeDelta::FromMilliseconds(3600), |
| 239 base::TimeDelta::FromMilliseconds(3000), kInvalidThroughput); | 239 base::TimeDelta::FromMilliseconds(3000), 40); |
| 240 | 240 |
| 241 typical_network_quality[EFFECTIVE_CONNECTION_TYPE_2G] = NetworkQuality( | 241 typical_network_quality[EFFECTIVE_CONNECTION_TYPE_2G] = NetworkQuality( |
| 242 // Set to the 58th percentile of 2G RTT observations on Android. This | 242 // Set to the 58th percentile of 2G RTT observations on Android. This |
| 243 // corresponds to the median RTT observation when effective connection | 243 // corresponds to the median RTT observation when effective connection |
| 244 // type is 2G. | 244 // type is 2G. |
| 245 base::TimeDelta::FromMilliseconds(1800), | 245 base::TimeDelta::FromMilliseconds(1800), |
| 246 base::TimeDelta::FromMilliseconds(1500), kInvalidThroughput); | 246 base::TimeDelta::FromMilliseconds(1500), 75); |
| 247 | 247 |
| 248 typical_network_quality[EFFECTIVE_CONNECTION_TYPE_3G] = NetworkQuality( | 248 typical_network_quality[EFFECTIVE_CONNECTION_TYPE_3G] = NetworkQuality( |
| 249 // Set to the 75th percentile of 3G RTT observations on Android. This | 249 // Set to the 75th percentile of 3G RTT observations on Android. This |
| 250 // corresponds to the median RTT observation when effective connection | 250 // corresponds to the median RTT observation when effective connection |
| 251 // type is 3G. | 251 // type is 3G. |
| 252 base::TimeDelta::FromMilliseconds(450), | 252 base::TimeDelta::FromMilliseconds(450), |
| 253 base::TimeDelta::FromMilliseconds(400), kInvalidThroughput); | 253 base::TimeDelta::FromMilliseconds(400), 400); |
| 254 | 254 |
| 255 // Set to the 25th percentile of 3G RTT observations on Android. | 255 // Set to the 25th percentile of 3G RTT observations on Android. |
| 256 typical_network_quality[EFFECTIVE_CONNECTION_TYPE_4G] = NetworkQuality( | 256 typical_network_quality[EFFECTIVE_CONNECTION_TYPE_4G] = |
| 257 base::TimeDelta::FromMilliseconds(175), | 257 NetworkQuality(base::TimeDelta::FromMilliseconds(175), |
| 258 base::TimeDelta::FromMilliseconds(125), kInvalidThroughput); | 258 base::TimeDelta::FromMilliseconds(125), 1600); |
| 259 | 259 |
| 260 static_assert( | 260 static_assert( |
| 261 EFFECTIVE_CONNECTION_TYPE_4G + 1 == EFFECTIVE_CONNECTION_TYPE_LAST, | 261 EFFECTIVE_CONNECTION_TYPE_4G + 1 == EFFECTIVE_CONNECTION_TYPE_LAST, |
| 262 "Missing effective connection type"); | 262 "Missing effective connection type"); |
| 263 } | 263 } |
| 264 | 264 |
| 265 void ObtainEffectiveConnectionTypeModelParams( | 265 void ObtainEffectiveConnectionTypeModelParams( |
| 266 const std::map<std::string, std::string>& variation_params, | 266 const std::map<std::string, std::string>& variation_params, |
| 267 NetworkQuality connection_thresholds[]) { | 267 NetworkQuality connection_thresholds[]) { |
| 268 // First set the default thresholds. | 268 // First set the default thresholds. |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 (void)effective_connection_type_available; | 367 (void)effective_connection_type_available; |
| 368 | 368 |
| 369 return forced_effective_connection_type; | 369 return forced_effective_connection_type; |
| 370 } | 370 } |
| 371 | 371 |
| 372 } // namespace internal | 372 } // namespace internal |
| 373 | 373 |
| 374 } // namespace nqe | 374 } // namespace nqe |
| 375 | 375 |
| 376 } // namespace net | 376 } // namespace net |
| OLD | NEW |