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

Unified Diff: net/base/network_quality.h

Issue 1164713004: Store network quality samples so we can compute percentiles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed mmenke comments Created 5 years, 6 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/base/network_quality.cc » ('j') | net/base/network_quality.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/network_quality.h
diff --git a/net/base/network_quality.h b/net/base/network_quality.h
index 4e2985776e0f4a8430b80c7523751391b4b0c0b7..882aab05246f6cbe876ea89ef368862040b5ae7a 100644
--- a/net/base/network_quality.h
+++ b/net/base/network_quality.h
@@ -8,42 +8,52 @@
#include <stdint.h>
#include "base/time/time.h"
+#include "net/base/net_export.h"
namespace net {
// API that is used to report the current network quality as estimated by the
// NetworkQualityEstimator.
-struct NET_EXPORT_PRIVATE NetworkQuality {
- NetworkQuality(const base::TimeDelta& fastest_rtt,
- double fastest_rtt_confidence,
- uint64_t peak_throughput_kbps,
- double peak_throughput_kbps_confidence)
- : fastest_rtt(fastest_rtt),
- fastest_rtt_confidence(fastest_rtt_confidence),
- peak_throughput_kbps(peak_throughput_kbps),
- peak_throughput_kbps_confidence(peak_throughput_kbps_confidence) {}
-
- ~NetworkQuality() {}
-
- // The fastest round trip time observed for the current connection.
- const base::TimeDelta fastest_rtt;
-
- // Confidence of the |fastest_rtt| estimate. Value lies between 0.0 and 1.0
+class NET_EXPORT_PRIVATE NetworkQuality {
+ public:
+ // |rtt| is the estimate of the round trip time for the current connection.
+ // |rtt_confidence| is the confidence of the |rtt| estimate.
+ // |throughput_kbps| is the estimate of the Kbps for the current connection.
+ // |throughput_kbps_confidence| is the confidence of the |throughput_kbps|
+ // estimate.
+ NetworkQuality(const base::TimeDelta& rtt,
+ double rtt_confidence,
+ uint64_t throughput_kbps,
bengr 2015/06/05 20:44:13 Be clear that this is downlink throuput.
tbansal1 2015/06/05 23:45:57 Done.
+ double throughput_kbps_confidence);
bengr 2015/06/05 20:44:13 Follow the design and make this an enum, and don't
tbansal1 2015/06/05 23:45:57 Will do this in next CL, added TODO
+
+ ~NetworkQuality();
+
+ // Returns the round trip time observed for the current connection.
+ base::TimeDelta GetRtt() const;
+
+ // Returns the throughput in Kbps observed for the current connection.
+ uint64_t GetThroughputKbps() const;
bengr 2015/06/05 20:44:13 GetDownlinkThroughputKbps? Should this be an int3
tbansal1 2015/06/05 23:45:57 Added TODO.
+
+ private:
+ // The round trip time observed for the current connection.
+ const base::TimeDelta rtt_;
+
+ // Confidence of the |rtt_| estimate. Value lies between 0.0 and 1.0
// with 0.0 being no confidence and 1.0 implying that estimates are same as
// ground truth.
// TODO(tbansal): Define units so values intermediate between 0.0 and 1.0 are
// meaningful.
- const double fastest_rtt_confidence;
+ const double rtt_confidence_;
bengr 2015/06/05 20:44:13 I would assign one confidence to the NetworkQualit
tbansal1 2015/06/05 23:45:57 Done.
- // Peak throughput in Kbps observed for the current connection.
- const uint64_t peak_throughput_kbps;
+ // Throughput in Kbps observed for the current connection.
+ const uint64_t throughput_kbps_;
- // Confidence of the |peak_throughput_kbps| estimate. Value lies between 0.0
+ // Confidence of the |throughput_kbps_| estimate. Value lies between 0.0
// and 1.0 with 0.0 being no confidence and 1.0 implying that estimates are
// same as ground truth.
// TODO(tbansal): Define units so values intermediate between 0.0 and 1.0 are
// meaningful.
- const double peak_throughput_kbps_confidence;
+ const double throughput_kbps_confidence_;
};
} // namespace net
« no previous file with comments | « no previous file | net/base/network_quality.cc » ('j') | net/base/network_quality.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698