diff options
author | Glen Kuhne <kuh@google.com> | 2016-04-21 15:24:02 -0700 |
---|---|---|
committer | Rebecca Silberstein <silberst@google.com> | 2016-04-27 18:57:52 +0000 |
commit | 5f001750a0ce82a8b3a47ac566117d4de27f3e23 (patch) | |
tree | 440d138531964ef9491a0331fa2f5b38dd7eae6d /service/java/com/android/server/wifi/WifiLastResortWatchdog.java | |
parent | 83f2b8087178705445e4d1618eaac832f9c633f4 (diff) | |
download | android_frameworks_opt_net_wifi-5f001750a0ce82a8b3a47ac566117d4de27f3e23.tar.gz android_frameworks_opt_net_wifi-5f001750a0ce82a8b3a47ac566117d4de27f3e23.tar.bz2 android_frameworks_opt_net_wifi-5f001750a0ce82a8b3a47ac566117d4de27f3e23.zip |
WifiLastResortWatchdog metrics
Added logging of various metrics to the WifiLastResortWatchdog. These
metrics count the number of times the Watchdog triggers, and stats
counting the number of networks present at failure time for different
failure types.
BUG=27856474
Change-Id: If43836b1c33791fefb8000196b231c312161feef
Diffstat (limited to 'service/java/com/android/server/wifi/WifiLastResortWatchdog.java')
-rw-r--r-- | service/java/com/android/server/wifi/WifiLastResortWatchdog.java | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/WifiLastResortWatchdog.java b/service/java/com/android/server/wifi/WifiLastResortWatchdog.java index adb8771ea..a953404c5 100644 --- a/service/java/com/android/server/wifi/WifiLastResortWatchdog.java +++ b/service/java/com/android/server/wifi/WifiLastResortWatchdog.java @@ -78,6 +78,12 @@ public class WifiLastResortWatchdog { // successfully connecting or a new network (SSID) becomes available to connect to. private boolean mWatchdogAllowedToTrigger = true; + private WifiMetrics mWifiMetrics; + + WifiLastResortWatchdog(WifiMetrics wifiMetrics) { + mWifiMetrics = wifiMetrics; + } + /** * Refreshes recentAvailableNetworks with the latest available networks * Adds new networks, removes old ones that have timed out. Should be called after Wifi @@ -325,11 +331,35 @@ public class WifiLastResortWatchdog { } /** - * Update WifiMetrics with various Watchdog stats (trigger counts, tracked network count) + * Update WifiMetrics with various Watchdog stats (trigger counts, failed network counts) */ private void incrementWifiMetricsTriggerCounts() { if (VDBG) Log.v(TAG, "incrementWifiMetricsTriggerCounts."); - // <TODO> + mWifiMetrics.incrementNumLastResortWatchdogTriggers(); + mWifiMetrics.addCountToNumLastResortWatchdogAvailableNetworksTotal( + mSsidFailureCount.size()); + // Number of networks over each failure type threshold, present at trigger time + int badAuth = 0; + int badAssoc = 0; + int badDhcp = 0; + for (Map.Entry<String, Pair<AvailableNetworkFailureCount, Integer>> entry + : mSsidFailureCount.entrySet()) { + badAuth += (entry.getValue().first.authenticationFailure >= FAILURE_THRESHOLD) ? 1 : 0; + badAssoc += (entry.getValue().first.associationRejection >= FAILURE_THRESHOLD) ? 1 : 0; + badDhcp += (entry.getValue().first.dhcpFailure >= FAILURE_THRESHOLD) ? 1 : 0; + } + if (badAuth > 0) { + mWifiMetrics.addCountToNumLastResortWatchdogBadAuthenticationNetworksTotal(badAuth); + mWifiMetrics.incrementNumLastResortWatchdogTriggersWithBadAuthentication(); + } + if (badAssoc > 0) { + mWifiMetrics.addCountToNumLastResortWatchdogBadAssociationNetworksTotal(badAssoc); + mWifiMetrics.incrementNumLastResortWatchdogTriggersWithBadAssociation(); + } + if (badDhcp > 0) { + mWifiMetrics.addCountToNumLastResortWatchdogBadDhcpNetworksTotal(badDhcp); + mWifiMetrics.incrementNumLastResortWatchdogTriggersWithBadDhcp(); + } } /** |