Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2010)

Unified Diff: net/nqe/network_quality_estimator.cc

Issue 2116893002: NQE: Record how frequently NetworkID is available (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/nqe/network_quality_estimator.cc
diff --git a/net/nqe/network_quality_estimator.cc b/net/nqe/network_quality_estimator.cc
index 3756629a07e8153c0eb388221e3749b4df35d72e..7f0fb4451b628a40b0149d1f510d37bc67e8f63f 100644
--- a/net/nqe/network_quality_estimator.cc
+++ b/net/nqe/network_quality_estimator.cc
@@ -740,7 +740,10 @@ void NetworkQualityEstimator::OnConnectionTypeChanged(
peak_network_quality_ = nqe::internal::NetworkQuality();
downstream_throughput_kbps_observations_.Clear();
rtt_observations_.Clear();
+
+ // Update the local state for the new connection.
bengr 2016/07/08 17:00:07 I don't understand this comment.
tbansal1 2016/07/08 18:39:08 Reworded. First, the local state is cleared ("// C
current_network_id_ = GetCurrentNetworkID();
+ RecordNetworkIDAvailability();
// Query the external estimate provider on certain connection types. Once the
// updated estimates are available, OnUpdatedEstimateAvailable will be called
@@ -835,6 +838,16 @@ void NetworkQualityEstimator::RecordMetricsOnConnectionTypeChanged() const {
}
}
+void NetworkQualityEstimator::RecordNetworkIDAvailability() const {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ if (current_network_id_.type ==
+ NetworkChangeNotifier::ConnectionType::CONNECTION_WIFI ||
+ NetworkChangeNotifier::IsConnectionCellular(current_network_id_.type)) {
+ UMA_HISTOGRAM_BOOLEAN("NQE.NetworkIdAvailable",
+ !current_network_id_.id.empty());
+ }
+}
+
void NetworkQualityEstimator::RecordMetricsOnMainFrameRequest() const {
DCHECK(thread_checker_.CalledOnValidThread());

Powered by Google App Engine
This is Rietveld 408576698