Skip to content

Commit 14b4c76

Browse files
Tsu Chiang ChuangAndroid (Google) Code Review
authored andcommitted
Merge "adding packet count and removing extra uid stats that were used for debugging."
2 parents a3b06ff + 9cf416f commit 14b4c76

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/DataIdleTest/src/com/android/tests/dataidle/DataIdleTest.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,27 @@ void reportStats(NetworkStats stats) {
8989
Bundle result = new Bundle();
9090
long rxBytes = 0;
9191
long txBytes = 0;
92+
long rxPackets = 0;
93+
long txPackets = 0;
9294
for (int i = 0; i < stats.size(); ++i) {
9395
// Label will be iface_uid_tag_set
9496
Entry statsEntry = stats.getValues(i, null);
97+
// Debugging use.
98+
/*
9599
String labelTemplate = String.format("%s_%d_%d_%d", statsEntry.iface, statsEntry.uid,
96100
statsEntry.tag, statsEntry.set) + "_%s";
97101
result.putLong(String.format(labelTemplate, "rxBytes"), statsEntry.rxBytes);
98102
result.putLong(String.format(labelTemplate, "txBytes"), statsEntry.txBytes);
103+
*/
104+
rxPackets += statsEntry.rxPackets;
99105
rxBytes += statsEntry.rxBytes;
106+
txPackets += statsEntry.txPackets;
100107
txBytes += statsEntry.txBytes;
101108
}
102-
result.putLong("Total rxBytes", rxBytes);
103-
result.putLong("Total txBytes", txBytes);
109+
result.putLong("Total rx Bytes", rxBytes);
110+
result.putLong("Total tx Bytes", txBytes);
111+
result.putLong("Total rx Packets", rxPackets);
112+
result.putLong("Total tx Packets", txPackets);
104113
getInstrumentation().sendStatus(INSTRUMENTATION_IN_PROGRESS, result);
105114

106115
}

0 commit comments

Comments
 (0)