| 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 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1026 int32_t downstream_throughput_kbps = nqe::internal::kInvalidThroughput; | 1026 int32_t downstream_throughput_kbps = nqe::internal::kInvalidThroughput; |
| 1027 | 1027 |
| 1028 effective_connection_type_ = | 1028 effective_connection_type_ = |
| 1029 GetRecentEffectiveConnectionTypeAndNetworkQuality( | 1029 GetRecentEffectiveConnectionTypeAndNetworkQuality( |
| 1030 base::TimeTicks(), &http_rtt, &transport_rtt, | 1030 base::TimeTicks(), &http_rtt, &transport_rtt, |
| 1031 &downstream_throughput_kbps); | 1031 &downstream_throughput_kbps); |
| 1032 | 1032 |
| 1033 network_quality_ = nqe::internal::NetworkQuality(http_rtt, transport_rtt, | 1033 network_quality_ = nqe::internal::NetworkQuality(http_rtt, transport_rtt, |
| 1034 downstream_throughput_kbps); | 1034 downstream_throughput_kbps); |
| 1035 | 1035 |
| 1036 UMA_HISTOGRAM_ENUMERATION("NQE.EffectiveConnectionType.OnECTComputation", |
| 1037 effective_connection_type_, |
| 1038 EFFECTIVE_CONNECTION_TYPE_LAST); |
| 1039 if (network_quality_.http_rtt() != nqe::internal::InvalidRTT()) { |
| 1040 UMA_HISTOGRAM_TIMES("NQE.RTT.OnECTComputation", |
| 1041 network_quality_.http_rtt()); |
| 1042 } |
| 1043 |
| 1044 if (network_quality_.transport_rtt() != nqe::internal::InvalidRTT()) { |
| 1045 UMA_HISTOGRAM_TIMES("NQE.TransportRTT.OnECTComputation", |
| 1046 network_quality_.transport_rtt()); |
| 1047 } |
| 1048 |
| 1049 if (network_quality_.downstream_throughput_kbps() != |
| 1050 nqe::internal::INVALID_RTT_THROUGHPUT) { |
| 1051 UMA_HISTOGRAM_COUNTS_1M("NQE.Kbps.OnECTComputation", |
| 1052 network_quality_.downstream_throughput_kbps()); |
| 1053 } |
| 1054 |
| 1036 NotifyObserversOfRTTOrThroughputComputed(); | 1055 NotifyObserversOfRTTOrThroughputComputed(); |
| 1037 | 1056 |
| 1038 if (past_type != effective_connection_type_) | 1057 if (past_type != effective_connection_type_) |
| 1039 NotifyObserversOfEffectiveConnectionTypeChanged(); | 1058 NotifyObserversOfEffectiveConnectionTypeChanged(); |
| 1040 | 1059 |
| 1041 event_creator_.MaybeAddEffectiveConnectionTypeChangedEventToNetLog( | 1060 event_creator_.MaybeAddEffectiveConnectionTypeChangedEventToNetLog( |
| 1042 effective_connection_type_, network_quality_); | 1061 effective_connection_type_, network_quality_); |
| 1043 | 1062 |
| 1044 rtt_observations_size_at_last_ect_computation_ = rtt_observations_.Size(); | 1063 rtt_observations_size_at_last_ect_computation_ = rtt_observations_.Size(); |
| 1045 throughput_observations_size_at_last_ect_computation_ = | 1064 throughput_observations_size_at_last_ect_computation_ = |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1714 NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_CACHED_ESTIMATE); | 1733 NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_CACHED_ESTIMATE); |
| 1715 downstream_throughput_kbps_observations_.AddObservation( | 1734 downstream_throughput_kbps_observations_.AddObservation( |
| 1716 throughput_observation); | 1735 throughput_observation); |
| 1717 NotifyObserversOfThroughput(throughput_observation); | 1736 NotifyObserversOfThroughput(throughput_observation); |
| 1718 } | 1737 } |
| 1719 | 1738 |
| 1720 ComputeEffectiveConnectionType(); | 1739 ComputeEffectiveConnectionType(); |
| 1721 } | 1740 } |
| 1722 | 1741 |
| 1723 } // namespace net | 1742 } // namespace net |
| OLD | NEW |