diff options
author | Michael Plass <mplass@google.com> | 2018-02-20 09:26:16 -0800 |
---|---|---|
committer | Michael Plass <mplass@google.com> | 2018-02-26 09:47:36 -0800 |
commit | 836a66aaa196390e5d142fa40adbea295182ac61 (patch) | |
tree | 320044f8ae1dfdd74f5e42938e66a625c39aec32 /service | |
parent | cf59643a1cdbcab677abe2f4ba2d38c275c59219 (diff) |
[WifiScoreReport] Decrease dumpsys limit, note netid
We don't often need 12 hours of screen-on logging; decrease to 3 hours.
Add a column containing the NetworkAgent netId to make it easier to
match up with other bug report sections.
Bug: 73127862
Test: Unit tests
Test: Manually check dumpsys output
Change-Id: I1d22e4a1183dcf3648b10a06b3cc298f20c6f85c
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiScoreReport.java | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/service/java/com/android/server/wifi/WifiScoreReport.java b/service/java/com/android/server/wifi/WifiScoreReport.java index ae100c24f..b8b5f029b 100644 --- a/service/java/com/android/server/wifi/WifiScoreReport.java +++ b/service/java/com/android/server/wifi/WifiScoreReport.java @@ -35,7 +35,7 @@ import java.util.Locale; public class WifiScoreReport { private static final String TAG = "WifiScoreReport"; - private static final int DUMPSYS_ENTRY_COUNT_LIMIT = 14400; // 12 hours on 3 second poll + private static final int DUMPSYS_ENTRY_COUNT_LIMIT = 3600; // 3 hours on 3 second poll private boolean mVerboseLoggingEnabled = false; private static final long FIRST_REASONABLE_WALL_CLOCK = 1490000000000L; // mid-December 2016 @@ -116,6 +116,11 @@ public class WifiScoreReport { int score; long millis = mClock.getWallClockMillis(); + int netId = 0; + + if (networkAgent != null) { + netId = networkAgent.netId; + } mConnectedScore.updateUsingWifiInfo(wifiInfo, millis); mAggressiveConnectedScore.updateUsingWifiInfo(wifiInfo, millis); @@ -135,7 +140,7 @@ public class WifiScoreReport { score = 0; } - logLinkMetrics(wifiInfo, millis, s0, s1, s2); + logLinkMetrics(wifiInfo, millis, netId, s0, s1, s2); //report score if (score != wifiInfo.score) { @@ -163,7 +168,8 @@ public class WifiScoreReport { /** * Data logging for dumpsys */ - private void logLinkMetrics(WifiInfo wifiInfo, long now, int s0, int s1, int s2) { + private void logLinkMetrics(WifiInfo wifiInfo, long now, int netId, + int s0, int s1, int s2) { if (now < FIRST_REASONABLE_WALL_CLOCK) return; double rssi = wifiInfo.getRssi(); double filteredRssi = mFancyConnectedScore.getFilteredRssi(); @@ -178,8 +184,9 @@ public class WifiScoreReport { try { String timestamp = new SimpleDateFormat("MM-dd HH:mm:ss.SSS").format(new Date(now)); s = String.format(Locale.US, // Use US to avoid comma/decimal confusion - "%s,%d,%.1f,%.1f,%.1f,%d,%d,%.2f,%.2f,%.2f,%.2f,%d,%d,%d", - timestamp, mSessionNumber, rssi, filteredRssi, rssiThreshold, freq, linkSpeed, + "%s,%d,%d,%.1f,%.1f,%.1f,%d,%d,%.2f,%.2f,%.2f,%.2f,%d,%d,%d", + timestamp, mSessionNumber, netId, + rssi, filteredRssi, rssiThreshold, freq, linkSpeed, txSuccessRate, txRetriesRate, txBadRate, rxSuccessRate, s0, s1, s2); } catch (Exception e) { @@ -210,7 +217,7 @@ public class WifiScoreReport { synchronized (mLinkMetricsHistory) { history = new LinkedList<>(mLinkMetricsHistory); } - pw.println("time,session,rssi,filtered_rssi,rssi_threshold," + pw.println("time,session,netid,rssi,filtered_rssi,rssi_threshold," + "freq,linkspeed,tx_good,tx_retry,tx_bad,rx_pps,s0,s1,s2"); for (String line : history) { pw.println(line); |