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

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: Added more details to histogram description 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 d396e79adfe726c61d0d71599fd30703cadb4316..44fb30393014ae0b05b806e7912263ed3f5e4028 100644
--- a/net/nqe/network_quality_estimator.h
+++ b/net/nqe/network_quality_estimator.h
@@ -349,6 +349,9 @@ class NET_EXPORT 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);
@@ -543,6 +546,15 @@ class NET_EXPORT 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;
+
+ // Returns true if transport RTT should be used for computing the effective
+ // connection type.
+ bool UseTransportRTT() 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_;
@@ -651,6 +663,13 @@ class NET_EXPORT NetworkQualityEstimator
int32_t min_signal_strength_since_connection_change_;
int32_t max_signal_strength_since_connection_change_;
+ // 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