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

Unified Diff: net/nqe/network_quality_estimator.cc

Issue 2654033010: NQE: Record the number of RTT and throughput samples received (Closed)
Patch Set: Fix test Created 3 years, 10 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_test_util.h » ('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 4c53f69aa4d54ed703bb56a12269236ea1d3be07..daa50cd7f4f09663b57660e92f621dc1980382c9 100644
--- a/net/nqe/network_quality_estimator.cc
+++ b/net/nqe/network_quality_estimator.cc
@@ -1476,10 +1476,12 @@ void NetworkQualityEstimator::OnUpdatedEstimateAvailable(
RecordExternalEstimateProviderMetrics(
EXTERNAL_ESTIMATE_PROVIDER_STATUS_RTT_AVAILABLE);
UMA_HISTOGRAM_TIMES("NQE.ExternalEstimateProvider.RTT", rtt);
- rtt_observations_.AddObservation(RttObservation(
+ RttObservation rtt_observation(
rtt, tick_clock_->NowTicks(), signal_strength_dbm_,
- NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_EXTERNAL_ESTIMATE));
+ NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_EXTERNAL_ESTIMATE);
+ rtt_observations_.AddObservation(rtt_observation);
external_estimate_provider_quality_.set_http_rtt(rtt);
+ NotifyObserversOfRTT(rtt_observation);
}
if (downstream_throughput_kbps > 0) {
@@ -1487,13 +1489,15 @@ void NetworkQualityEstimator::OnUpdatedEstimateAvailable(
EXTERNAL_ESTIMATE_PROVIDER_STATUS_DOWNLINK_BANDWIDTH_AVAILABLE);
UMA_HISTOGRAM_COUNTS("NQE.ExternalEstimateProvider.DownlinkBandwidth",
downstream_throughput_kbps);
+ ThroughputObservation throughput_observation(
+ downstream_throughput_kbps, tick_clock_->NowTicks(),
+ signal_strength_dbm_,
+ NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_EXTERNAL_ESTIMATE);
downstream_throughput_kbps_observations_.AddObservation(
- ThroughputObservation(
- downstream_throughput_kbps, tick_clock_->NowTicks(),
- signal_strength_dbm_,
- NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_EXTERNAL_ESTIMATE));
+ throughput_observation);
external_estimate_provider_quality_.set_downstream_throughput_kbps(
downstream_throughput_kbps);
+ NotifyObserversOfThroughput(throughput_observation);
}
}
@@ -1523,6 +1527,10 @@ void NetworkQualityEstimator::NotifyObserversOfRTT(
const RttObservation& observation) {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK_NE(nqe::internal::InvalidRTT(), observation.value);
+ DCHECK_GT(NETWORK_QUALITY_OBSERVATION_SOURCE_MAX, observation.source);
+
+ UMA_HISTOGRAM_ENUMERATION("NQE.RTT.ObservationSource", observation.source,
+ NETWORK_QUALITY_OBSERVATION_SOURCE_MAX);
// Maybe recompute the effective connection type since a new RTT observation
// is available.
@@ -1537,6 +1545,10 @@ void NetworkQualityEstimator::NotifyObserversOfThroughput(
const ThroughputObservation& observation) {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK_NE(nqe::internal::kInvalidThroughput, observation.value);
+ DCHECK_GT(NETWORK_QUALITY_OBSERVATION_SOURCE_MAX, observation.source);
+
+ UMA_HISTOGRAM_ENUMERATION("NQE.Kbps.ObservationSource", observation.source,
+ NETWORK_QUALITY_OBSERVATION_SOURCE_MAX);
// Maybe recompute the effective connection type since a new throughput
// observation is available.
« no previous file with comments | « net/nqe/network_quality_estimator.h ('k') | net/nqe/network_quality_estimator_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698