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

Unified Diff: net/nqe/network_quality_estimator.h

Issue 2107243003: NQE: Record correlation metric in UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed bengr comments Created 4 years, 5 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 | « no previous file | net/nqe/network_quality_estimator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/nqe/network_quality_estimator.h
diff --git a/net/nqe/network_quality_estimator.h b/net/nqe/network_quality_estimator.h
index b7fc886b5ab558f41fe1ed6a1e364c9bfb0e5fb6..4914414350881dbd1595d849b2152936af331dc5 100644
--- a/net/nqe/network_quality_estimator.h
+++ b/net/nqe/network_quality_estimator.h
@@ -338,6 +338,9 @@ class NET_EXPORT_PRIVATE NetworkQualityEstimator
// Overrides the tick clock used by |this| for testing.
void SetTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock);
+ // Returns a random double in the range [0.0, 1.0). Virtualized for testing.
+ virtual double RandDouble() const;
+
private:
FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, StoreObservations);
FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, TestAddObservation);
@@ -503,6 +506,11 @@ class NET_EXPORT_PRIVATE NetworkQualityEstimator
void RecordExternalEstimateProviderMetrics(
NQEExternalEstimateProviderStatus status) const;
+ // Records a correlation metric that can be used for computing the correlation
+ // between HTTP-layer RTT, transport-layer RTT, throughput and the time
+ // taken to complete |request|.
+ void RecordCorrelationMetric(const URLRequest& request) const;
+
// Determines if the requests to local host can be used in estimating the
// network quality. Set to true only for tests.
bool use_localhost_requests_;
@@ -606,6 +614,13 @@ class NET_EXPORT_PRIVATE NetworkQualityEstimator
// |effective_connection_type_recomputation_interval_| ago).
EffectiveConnectionType effective_connection_type_;
+ // It is costlier to add values to a sparse histogram. So, the correlation UMA
+ // is recorded with |correlation_uma_logging_probability_| since recording it
+ // in a sparse histogram for each request is unnecessary and cost-prohibitive.
+ // e.g., if it is 0.0, then the UMA will never be recorded. On the other hand,
+ // if it is 1.0, then it will be recorded for all valid HTTP requests.
+ const double correlation_uma_logging_probability_;
+
base::ThreadChecker thread_checker_;
base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_;
« no previous file with comments | « no previous file | net/nqe/network_quality_estimator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698