UMA Metric for reporting network problem while connected.
Added a UMA metric for reporting network problem while connected to
a network. Network problem is detected by TrafficMonitor. Max of one
network problem will be reported per connection.
BUG=chromium:374274
TEST=unit tests, manual
Manual Test:
1. Connect a chrome device an AP without internet access.
2. Wait for few minutes, then browse to "chrome://histograms", and verify
there is a histogram for Network.Shill.Wifi.NetworkProblemDetected".
Change-Id: Iad019d147feebcd429445c687a7c37d8e1e281f9
Reviewed-on: https://chromium-review.googlesource.com/200469
Reviewed-by: Peter Qiu <zqiu@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
diff --git a/metrics.h b/metrics.h
index 58ea4fd..9abdd0e 100644
--- a/metrics.h
+++ b/metrics.h
@@ -291,6 +291,13 @@
kDNSTestResultMax
};
+ // Network problem detected by traffic monitor.
+ enum NetworkProblem {
+ kNetworkProblemCongestedTCPTxQueue = 0,
+ kNetworkProblemDNSFailure,
+ kNetworkProblemMax
+ };
+
static const char kMetricDisconnectSuffix[];
static const int kMetricDisconnectMax;
static const int kMetricDisconnectMin;
@@ -494,6 +501,9 @@
// DNS test result.
static const char kMetricFallbackDNSTestResult[];
+ // Network problem detected by traffic monitor
+ static const char kMetricNetworkProblemDetectedSuffix[];
+
explicit Metrics(EventDispatcher *dispatcher);
virtual ~Metrics();
@@ -683,6 +693,11 @@
// Notifies this object about the result of the fallback DNS test.
virtual void NotifyFallbackDNSTestResult(int result);
+ // Notifies this object about a network problem detected on the currently
+ // connected network.
+ virtual void NotifyNetworkProblemDetected(
+ Technology::Identifier technology_id, int reason);
+
// Sends linear histogram data to UMA.
virtual bool SendEnumToUMA(const std::string &name, int sample, int max);