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

Unified Diff: net/nqe/network_quality_estimator.cc

Issue 2005143005: Record network quality UMA metrics on main frame requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed rebase issues Created 4 years, 7 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
« no previous file with comments | « net/nqe/network_quality_estimator.h ('k') | net/nqe/network_quality_estimator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/nqe/network_quality_estimator.cc
diff --git a/net/nqe/network_quality_estimator.cc b/net/nqe/network_quality_estimator.cc
index a42805fd529c5a25896cc0f26b4e894532a09fff..a4a469228d6be9853976cd7349d4227e6ff45d08 100644
--- a/net/nqe/network_quality_estimator.cc
+++ b/net/nqe/network_quality_estimator.cc
@@ -460,6 +460,8 @@ void NetworkQualityEstimator::NotifyHeadersReceived(const URLRequest& request) {
estimated_median_network_quality_ = nqe::internal::NetworkQuality(
estimated_http_rtt, nqe::internal::InvalidRTT(),
downstream_throughput_kbps);
+
+ RecordMetricsOnMainFrameRequest();
}
base::TimeTicks now = base::TimeTicks::Now();
@@ -697,6 +699,35 @@ void NetworkQualityEstimator::RecordMetricsOnConnectionTypeChanged() const {
}
}
+void NetworkQualityEstimator::RecordMetricsOnMainFrameRequest() const {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
+ base::TimeDelta http_rtt;
+ if (GetHttpRTTEstimate(&http_rtt)) {
+ // Add the 50th percentile value.
+ base::HistogramBase* rtt_percentile = GetHistogram(
+ "MainFrame.RTT.Percentile50.", current_network_id_.type, 10 * 1000);
+ rtt_percentile->Add(http_rtt.InMilliseconds());
+ }
+
+ base::TimeDelta transport_rtt;
+ if (GetTransportRTTEstimate(&transport_rtt)) {
+ // Add the 50th percentile value.
+ base::HistogramBase* transport_rtt_percentile =
+ GetHistogram("MainFrame.TransportRTT.Percentile50.",
+ current_network_id_.type, 10 * 1000);
+ transport_rtt_percentile->Add(transport_rtt.InMilliseconds());
+ }
+
+ int32_t kbps;
+ if (GetDownlinkThroughputKbpsEstimate(&kbps)) {
+ // Add the 50th percentile value.
+ base::HistogramBase* throughput_percentile = GetHistogram(
+ "MainFrame.Kbps.Percentile50.", current_network_id_.type, 1000 * 1000);
+ throughput_percentile->Add(kbps);
+ }
+}
+
NetworkQualityEstimator::EffectiveConnectionType
NetworkQualityEstimator::GetEffectiveConnectionType() const {
DCHECK(thread_checker_.CalledOnValidThread());
« no previous file with comments | « net/nqe/network_quality_estimator.h ('k') | net/nqe/network_quality_estimator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698