From 9cf416fde65fd5795d5e40be7bda0557611bc562 Mon Sep 17 00:00:00 2001 From: Tsu Chiang Chuang Date: Mon, 26 Sep 2011 14:33:24 -0700 Subject: adding packet count and removing extra uid stats that were used for debugging. Change-Id: I19664ee991760b9515fc129be50be68579f8ce93 --- .../src/com/android/tests/dataidle/DataIdleTest.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'tests/DataIdleTest') diff --git a/tests/DataIdleTest/src/com/android/tests/dataidle/DataIdleTest.java b/tests/DataIdleTest/src/com/android/tests/dataidle/DataIdleTest.java index b803b98..a13c0c9 100644 --- a/tests/DataIdleTest/src/com/android/tests/dataidle/DataIdleTest.java +++ b/tests/DataIdleTest/src/com/android/tests/dataidle/DataIdleTest.java @@ -89,18 +89,27 @@ public class DataIdleTest extends InstrumentationTestCase { Bundle result = new Bundle(); long rxBytes = 0; long txBytes = 0; + long rxPackets = 0; + long txPackets = 0; for (int i = 0; i < stats.size(); ++i) { // Label will be iface_uid_tag_set Entry statsEntry = stats.getValues(i, null); + // Debugging use. + /* String labelTemplate = String.format("%s_%d_%d_%d", statsEntry.iface, statsEntry.uid, statsEntry.tag, statsEntry.set) + "_%s"; result.putLong(String.format(labelTemplate, "rxBytes"), statsEntry.rxBytes); result.putLong(String.format(labelTemplate, "txBytes"), statsEntry.txBytes); + */ + rxPackets += statsEntry.rxPackets; rxBytes += statsEntry.rxBytes; + txPackets += statsEntry.txPackets; txBytes += statsEntry.txBytes; } - result.putLong("Total rxBytes", rxBytes); - result.putLong("Total txBytes", txBytes); + result.putLong("Total rx Bytes", rxBytes); + result.putLong("Total tx Bytes", txBytes); + result.putLong("Total rx Packets", rxPackets); + result.putLong("Total tx Packets", txPackets); getInstrumentation().sendStatus(INSTRUMENTATION_IN_PROGRESS, result); } -- cgit v1.1