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

Unified Diff: net/nqe/network_quality_estimator.h

Issue 2020353002: Record NQE accuracy at main frame requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | net/nqe/network_quality_estimator.cc » ('j') | net/nqe/network_quality_estimator.cc » ('J')
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 2abc9fd7d6f7bffbcea10f7262ff497dbeb225c8..e2dc77ac108d45f98216a41afac78a193d349495 100644
--- a/net/nqe/network_quality_estimator.h
+++ b/net/nqe/network_quality_estimator.h
@@ -191,7 +191,8 @@ class NET_EXPORT_PRIVATE NetworkQualityEstimator
// Returns true if the RTT is available and sets |rtt| to the RTT estimated at
// the transport layer. |rtt| should not be null.
- bool GetTransportRTTEstimate(base::TimeDelta* rtt) const WARN_UNUSED_RESULT;
+ virtual bool GetTransportRTTEstimate(base::TimeDelta* rtt) const
bengr 2016/06/01 16:55:29 Add to the comment that this is virtualized for te
tbansal1 2016/06/01 21:49:02 Done.
+ WARN_UNUSED_RESULT;
// Returns true if downlink throughput is available and sets |kbps| to
// estimated downlink throughput (in kilobits per second).
@@ -226,8 +227,8 @@ class NET_EXPORT_PRIVATE NetworkQualityEstimator
// Returns true if the median RTT at the transport layer is available and sets
// |rtt| to the median of transport layer RTT observations since
// |start_time|. |rtt| should not be null.
- bool GetRecentTransportRTTMedian(const base::TimeTicks& start_time,
- base::TimeDelta* rtt) const
+ virtual bool GetRecentTransportRTTMedian(const base::TimeTicks& start_time,
bengr 2016/06/01 16:55:29 Add to the comment that this is virtualized for te
tbansal1 2016/06/01 21:49:02 Done.
+ base::TimeDelta* rtt) const
WARN_UNUSED_RESULT;
// Returns true if median downstream throughput is available and sets |kbps|
@@ -310,6 +311,11 @@ class NET_EXPORT_PRIVATE NetworkQualityEstimator
const char* GetNameForEffectiveConnectionType(
EffectiveConnectionType type) const;
+ // Virtualized for testing. Returns the list of intervals at which accuracy of
bengr 2016/06/01 16:55:30 nits: which -> which the Move the first sentence t
tbansal1 2016/06/01 21:49:02 Done.
+ // network quality prediction should be recorded.
+ virtual const std::vector<base::TimeDelta>& GetAccuracyRecordingIntervals()
+ const;
+
// Overrides the tick clock used by |this| for testing.
void SetTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock);
@@ -439,6 +445,13 @@ class NET_EXPORT_PRIVATE NetworkQualityEstimator
// Notify observers of a change in effective connection type.
void NotifyObserversOfEffectiveConnectionTypeChanged();
+ // Records NQE accuracy metrics. |measuring_duration| should belong to the
+ // vector returned by AccuracyRecordingIntervals().
+ // RecordAccuracyAfterMainFrame should be called |measuring_duration| after a
+ // main frame request is observed.
+ void RecordAccuracyAfterMainFrame(
+ const base::TimeDelta& measuring_duration) const;
+
// Values of external estimate provider status. This enum must remain
// synchronized with the enum of the same name in
// metrics/histograms/histograms.xml.
@@ -479,6 +492,10 @@ class NET_EXPORT_PRIVATE NetworkQualityEstimator
// Time when the effective connection type was last computed.
base::TimeTicks last_effective_connection_type_computation_;
+ // Intervals after the main frame request arrives at which accuracy of network
+ // quality prediction is recorded.
+ std::vector<base::TimeDelta> accuracy_recording_intervals_;
+
// Time when last connection change was observed.
base::TimeTicks last_connection_change_;
@@ -516,8 +533,11 @@ class NET_EXPORT_PRIVATE NetworkQualityEstimator
nqe::internal::NetworkQuality
connection_thresholds_[EFFECTIVE_CONNECTION_TYPE_LAST];
+ // Latest time when the headers for a main frame request were received.
+ base::TimeTicks last_main_frame_request_;
+
// Estimated network quality. Updated on mainframe requests.
- nqe::internal::NetworkQuality estimated_median_network_quality_;
+ nqe::internal::NetworkQuality estimated_quality_main_frame_;
bengr 2016/06/01 16:55:29 estimated_quality_at_last_main_frame_request_? or
tbansal1 2016/06/01 21:49:02 Done.
// ExternalEstimateProvider that provides network quality using operating
// system APIs. May be NULL.
« no previous file with comments | « no previous file | net/nqe/network_quality_estimator.cc » ('j') | net/nqe/network_quality_estimator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698