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

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: Added tests, changed kbps to int32_t, removed confidence 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
Index: net/base/network_quality.h
diff --git a/net/base/network_quality.h b/net/base/network_quality.h
index 4e2985776e0f4a8430b80c7523751391b4b0c0b7..93e7b8fccfa4379878ca12b4280b78c7dc9103bd 100644
--- a/net/base/network_quality.h
+++ b/net/base/network_quality.h
@@ -8,42 +8,37 @@
#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
- // 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;
-
- // Peak throughput in Kbps observed for the current connection.
- const uint64_t peak_throughput_kbps;
-
- // Confidence of the |peak_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;
+class NET_EXPORT_PRIVATE NetworkQuality {
+ public:
+ // |rtt| is the estimate of the round trip time for the current connection.
+ // |downstream_throughput_kbps| is the estimate of the downstram throughput
+ // for the current connection.
+ NetworkQuality(const base::TimeDelta& rtt,
+ int32_t downstream_throughput_kbps);
+
+ ~NetworkQuality();
+
+ // Returns the round trip time observed for the current connection.
bengr 2015/06/09 20:46:33 You could add the clause "for the current connecti
tbansal1 2015/06/10 01:00:05 Actually, there is nothing that says NetworkQualit
+ base::TimeDelta rtt() const { return rtt_; }
bengr 2015/06/09 20:46:32 Should this return a const&?
tbansal1 2015/06/10 01:00:05 Done.
+
+ // Returns the downstream throughput in Kbps observed for the current
+ // connection.
+ int32_t downstream_throughput_kbps() const {
+ return downstream_throughput_kbps_;
+ }
+
+ private:
+ // The round trip time observed for the current connection.
+ const base::TimeDelta rtt_;
+
+ // Downstream throughput in Kbps observed for the current connection.
+ const int32_t downstream_throughput_kbps_;
};
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698