summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMingguang Xu <mingguangxu@google.com>2019-03-22 17:08:57 -0700
committerMingguang Xu <mingguangxu@google.com>2019-03-26 16:25:36 -0700
commit83ca5f56f59f919845ce38768dfa2ad29ea6ac65 (patch)
tree1a2bf17d3f3850edf17b5f54a7a7da7daadd4fc9 /tests
parent67ea084b08b7155fd760f3e8853ff4d4a0dcd3f9 (diff)
Wifi usability: A couple of tweaks to Wifi usability data collection
1. Change the range of Wifi usability score from [0,60] to [0,100]: Usability score represents the estimated probability of Wifi usability so it is more convenient to use the range of [0,100] for metric collection purpose (no action is taken). 2. Capture up to 40 samples (equivalently 2 mins) per dataset. 2-min usability stats can provide more information on how Wifi networks gradually become unusable. 3. The minimum gap between two events is checked based on the event time, which is the timestamp of the last entry in the ring buffer. Note that the timestamp of the first entry cannot represent the time when event happens. Bug: 113262380 Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: Ib775fd4b73d04956c53d76a8a4b905851764dcab Signed-off-by: Mingguang Xu <mingguangxu@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java28
1 files changed, 18 insertions, 10 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
index dda7fa8f2..8d095679c 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
@@ -2863,17 +2863,21 @@ public class WifiMetricsTest {
WifiLinkLayerStats stats3 = new WifiLinkLayerStats();
WifiLinkLayerStats stats4 = new WifiLinkLayerStats();
- stats4.timeStampInMs = stats3.timeStampInMs - 1 + WifiMetrics.MIN_DATA_STALL_WAIT_MS;
- for (int i = 0; i < WifiMetrics.MAX_WIFI_USABILITY_STATS_ENTRIES_LIST_SIZE - 2; i++) {
+ for (int i = 0; i < WifiMetrics.MAX_WIFI_USABILITY_STATS_ENTRIES_LIST_SIZE - 1; i++) {
mWifiMetrics.updateWifiUsabilityStatsEntries(info, stats3);
stats3 = nextRandomStats(stats3);
}
- addBadWifiUsabilityStats(stats3);
- for (int i = 0; i < WifiMetrics.MAX_WIFI_USABILITY_STATS_ENTRIES_LIST_SIZE - 2; i++) {
+ mWifiMetrics.updateWifiUsabilityStatsEntries(info, stats3);
+ mWifiMetrics.addToWifiUsabilityStatsList(WifiUsabilityStats.LABEL_BAD,
+ WifiUsabilityStats.TYPE_DATA_STALL_BAD_TX);
+ for (int i = 0; i < WifiMetrics.MAX_WIFI_USABILITY_STATS_ENTRIES_LIST_SIZE - 1; i++) {
mWifiMetrics.updateWifiUsabilityStatsEntries(info, stats4);
stats4 = nextRandomStats(stats4);
}
- addBadWifiUsabilityStats(stats4);
+ stats4.timeStampInMs = stats3.timeStampInMs - 1 + WifiMetrics.MIN_DATA_STALL_WAIT_MS;
+ mWifiMetrics.updateWifiUsabilityStatsEntries(info, stats4);
+ mWifiMetrics.addToWifiUsabilityStatsList(WifiUsabilityStats.LABEL_BAD,
+ WifiUsabilityStats.TYPE_DATA_STALL_BAD_TX);
dumpProtoAndDeserialize();
assertEquals(2, mDecodedProto.wifiUsabilityStatsList.length);
}
@@ -2898,17 +2902,21 @@ public class WifiMetricsTest {
WifiLinkLayerStats stats3 = new WifiLinkLayerStats();
WifiLinkLayerStats stats4 = new WifiLinkLayerStats();
- stats4.timeStampInMs = stats3.timeStampInMs + 1 + WifiMetrics.MIN_DATA_STALL_WAIT_MS;
- for (int i = 0; i < WifiMetrics.MAX_WIFI_USABILITY_STATS_ENTRIES_LIST_SIZE - 2; i++) {
+ for (int i = 0; i < WifiMetrics.MAX_WIFI_USABILITY_STATS_ENTRIES_LIST_SIZE - 1; i++) {
mWifiMetrics.updateWifiUsabilityStatsEntries(info, stats3);
stats3 = nextRandomStats(stats3);
}
- addBadWifiUsabilityStats(stats3);
- for (int i = 0; i < WifiMetrics.MAX_WIFI_USABILITY_STATS_ENTRIES_LIST_SIZE - 2; i++) {
+ mWifiMetrics.updateWifiUsabilityStatsEntries(info, stats3);
+ mWifiMetrics.addToWifiUsabilityStatsList(WifiUsabilityStats.LABEL_BAD,
+ WifiUsabilityStats.TYPE_DATA_STALL_BAD_TX);
+ for (int i = 0; i < WifiMetrics.MAX_WIFI_USABILITY_STATS_ENTRIES_LIST_SIZE - 1; i++) {
mWifiMetrics.updateWifiUsabilityStatsEntries(info, stats4);
stats4 = nextRandomStats(stats4);
}
- addBadWifiUsabilityStats(stats4);
+ stats4.timeStampInMs = stats3.timeStampInMs + 1 + WifiMetrics.MIN_DATA_STALL_WAIT_MS;
+ mWifiMetrics.updateWifiUsabilityStatsEntries(info, stats4);
+ mWifiMetrics.addToWifiUsabilityStatsList(WifiUsabilityStats.LABEL_BAD,
+ WifiUsabilityStats.TYPE_DATA_STALL_BAD_TX);
dumpProtoAndDeserialize();
assertEquals(4, mDecodedProto.wifiUsabilityStatsList.length);
}