@@ -236,6 +236,7 @@ NetworkQualityEstimator::NetworkQualityEstimator(
236
236
rtt_observations_size_at_last_ect_computation_(0 ),
237
237
throughput_observations_size_at_last_ect_computation_(0 ),
238
238
transport_rtt_observation_count_last_ect_computation_(0 ),
239
+ end_to_end_rtt_observation_count_at_last_ect_computation_(0 ),
239
240
new_rtt_observations_since_last_ect_computation_(0 ),
240
241
new_throughput_observations_since_last_ect_computation_(0 ),
241
242
increase_in_transport_rtt_updater_posted_(false ),
@@ -695,6 +696,7 @@ void NetworkQualityEstimator::OnConnectionTypeChanged(
695
696
min_signal_strength_since_connection_change_.reset ();
696
697
max_signal_strength_since_connection_change_.reset ();
697
698
network_quality_ = nqe::internal::NetworkQuality ();
699
+ end_to_end_rtt_ = base::nullopt;
698
700
effective_connection_type_ = EFFECTIVE_CONNECTION_TYPE_UNKNOWN;
699
701
effective_connection_type_at_last_main_frame_ =
700
702
EFFECTIVE_CONNECTION_TYPE_UNKNOWN;
@@ -703,6 +705,7 @@ void NetworkQualityEstimator::OnConnectionTypeChanged(
703
705
new_rtt_observations_since_last_ect_computation_ = 0 ;
704
706
new_throughput_observations_since_last_ect_computation_ = 0 ;
705
707
transport_rtt_observation_count_last_ect_computation_ = 0 ;
708
+ end_to_end_rtt_observation_count_at_last_ect_computation_ = 0 ;
706
709
last_socket_watcher_rtt_notification_ = base::TimeTicks ();
707
710
estimated_quality_at_last_main_frame_ = nqe::internal::NetworkQuality ();
708
711
cached_estimate_applied_ = false ;
@@ -1023,7 +1026,8 @@ void NetworkQualityEstimator::ComputeEffectiveConnectionType() {
1023
1026
GetRecentEffectiveConnectionTypeAndNetworkQuality (
1024
1027
base::TimeTicks (), &http_rtt, &transport_rtt, &end_to_end_rtt,
1025
1028
&downstream_throughput_kbps,
1026
- &transport_rtt_observation_count_last_ect_computation_);
1029
+ &transport_rtt_observation_count_last_ect_computation_,
1030
+ &end_to_end_rtt_observation_count_at_last_ect_computation_);
1027
1031
1028
1032
network_quality_ = nqe::internal::NetworkQuality (http_rtt, transport_rtt,
1029
1033
downstream_throughput_kbps);
@@ -1045,6 +1049,9 @@ void NetworkQualityEstimator::ComputeEffectiveConnectionType() {
1045
1049
if (end_to_end_rtt != nqe::internal::InvalidRTT ()) {
1046
1050
UMA_HISTOGRAM_TIMES (" NQE.EndToEndRTT.OnECTComputation" , end_to_end_rtt);
1047
1051
}
1052
+ end_to_end_rtt_ = base::nullopt;
1053
+ if (end_to_end_rtt != nqe::internal::InvalidRTT ())
1054
+ end_to_end_rtt_ = end_to_end_rtt;
1048
1055
1049
1056
if (network_quality_.downstream_throughput_kbps () !=
1050
1057
nqe::internal::INVALID_RTT_THROUGHPUT) {
@@ -1089,7 +1096,7 @@ NetworkQualityEstimator::GetRecentEffectiveConnectionType(
1089
1096
1090
1097
return GetRecentEffectiveConnectionTypeAndNetworkQuality (
1091
1098
start_time, &http_rtt, &transport_rtt, &end_to_end_rtt,
1092
- &downstream_throughput_kbps, nullptr );
1099
+ &downstream_throughput_kbps, nullptr , nullptr );
1093
1100
}
1094
1101
1095
1102
EffectiveConnectionType
@@ -1099,7 +1106,8 @@ NetworkQualityEstimator::GetRecentEffectiveConnectionTypeAndNetworkQuality(
1099
1106
base::TimeDelta* transport_rtt,
1100
1107
base::TimeDelta* end_to_end_rtt,
1101
1108
int32_t * downstream_throughput_kbps,
1102
- size_t * transport_rtt_observation_count) const {
1109
+ size_t * transport_rtt_observation_count,
1110
+ size_t * end_to_end_rtt_observation_count) const {
1103
1111
DCHECK (thread_checker_.CalledOnValidThread ());
1104
1112
1105
1113
return GetRecentEffectiveConnectionTypeUsingMetrics (
@@ -1110,7 +1118,7 @@ NetworkQualityEstimator::GetRecentEffectiveConnectionTypeAndNetworkQuality(
1110
1118
NetworkQualityEstimator::MetricUsage::
1111
1119
USE_IF_AVAILABLE /* downstream_throughput_kbps_metric */ ,
1112
1120
http_rtt, transport_rtt, end_to_end_rtt, downstream_throughput_kbps,
1113
- transport_rtt_observation_count);
1121
+ transport_rtt_observation_count, end_to_end_rtt_observation_count );
1114
1122
}
1115
1123
1116
1124
EffectiveConnectionType
@@ -1123,7 +1131,8 @@ NetworkQualityEstimator::GetRecentEffectiveConnectionTypeUsingMetrics(
1123
1131
base::TimeDelta* transport_rtt,
1124
1132
base::TimeDelta* end_to_end_rtt,
1125
1133
int32_t * downstream_throughput_kbps,
1126
- size_t * transport_rtt_observation_count) const {
1134
+ size_t * transport_rtt_observation_count,
1135
+ size_t * end_to_end_rtt_observation_count) const {
1127
1136
DCHECK (thread_checker_.CalledOnValidThread ());
1128
1137
1129
1138
*http_rtt = nqe::internal::InvalidRTT ();
@@ -1161,7 +1170,7 @@ NetworkQualityEstimator::GetRecentEffectiveConnectionTypeUsingMetrics(
1161
1170
}
1162
1171
1163
1172
if (!GetRecentRTT (nqe::internal::OBSERVATION_CATEGORY_END_TO_END, start_time,
1164
- end_to_end_rtt, nullptr )) {
1173
+ end_to_end_rtt, end_to_end_rtt_observation_count )) {
1165
1174
*end_to_end_rtt = nqe::internal::InvalidRTT ();
1166
1175
}
1167
1176
0 commit comments