Skip to content

Commit e7171ef

Browse files
jsharkeyAndroid (Google) Code Review
authored andcommitted
Merge "List rotated netstats files during --checkin dump."
2 parents 8320e70 + 706498d commit e7171ef

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

services/java/com/android/server/net/NetworkStatsService.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@
117117
*/
118118
public class NetworkStatsService extends INetworkStatsService.Stub {
119119
private static final String TAG = "NetworkStats";
120-
private static final boolean LOGD = true;
121-
private static final boolean LOGV = true;
120+
private static final boolean LOGV = false;
122121

123122
private static final int MSG_PERFORM_POLL = 1;
124123
private static final int MSG_UPDATE_IFACES = 2;
@@ -858,8 +857,9 @@ protected void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
858857
argSet.add(arg);
859858
}
860859

861-
// usage: dumpsys netstats --full --uid --tag
860+
// usage: dumpsys netstats --full --uid --tag --poll --checkin
862861
final boolean poll = argSet.contains("--poll") || argSet.contains("poll");
862+
final boolean checkin = argSet.contains("--checkin");
863863
final boolean fullHistory = argSet.contains("--full") || argSet.contains("full");
864864
final boolean includeUid = argSet.contains("--uid") || argSet.contains("detail");
865865
final boolean includeTag = argSet.contains("--tag") || argSet.contains("detail");
@@ -873,6 +873,17 @@ protected void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
873873
return;
874874
}
875875

876+
if (checkin) {
877+
// list current stats files to verify rotation
878+
pw.println("Current files:");
879+
pw.increaseIndent();
880+
for (String file : mBaseDir.list()) {
881+
pw.println(file);
882+
}
883+
pw.decreaseIndent();
884+
return;
885+
}
886+
876887
pw.println("Active interfaces:");
877888
pw.increaseIndent();
878889
for (String iface : mActiveIfaces.keySet()) {

0 commit comments

Comments
 (0)