diff options
author | Jeff Sharkey <jsharkey@android.com> | 2011-08-25 17:48:52 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2011-08-26 14:19:54 -0700 |
commit | 47eb102b40cd1324d89816a7fb0fecd14fd7a408 (patch) | |
tree | 5387692119eb36fa75f73d17fa014a6528e3a0a4 /services/tests | |
parent | ed191e1fae0f860323f6ed76ea982287c42ec83e (diff) | |
download | frameworks_base-47eb102b40cd1324d89816a7fb0fecd14fd7a408.zip frameworks_base-47eb102b40cd1324d89816a7fb0fecd14fd7a408.tar.gz frameworks_base-47eb102b40cd1324d89816a7fb0fecd14fd7a408.tar.bz2 |
Always splice historical data stats, debug info.
When reading network counters, always splice in xt_qtaguid values
to avoid counting backwards. Test to verify.
Remove verbose logging around global alerts, and add dumpsys debug
info for NMS and MDST. Also fix subtle bug around stats persisting
and dumping.
Bug: 5212893, 5211028
Change-Id: I783e5286637a67ee2dd2b09878198711a926d0cb
Diffstat (limited to 'services/tests')
-rw-r--r-- | services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java b/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java index 5f35697..ecf78d9 100644 --- a/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java +++ b/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java @@ -117,6 +117,18 @@ public class NetworkManagementServiceTest extends AndroidTestCase { assertStatsEntry(stats, "wlan0", UID_ALL, SET_DEFAULT, TAG_NONE, 1024L, 2048L); } + public void testNetworkStatsCombined() throws Exception { + stageFile(R.raw.net_dev_typical, new File(mTestProc, "net/dev")); + stageLong(10L, new File(mTestProc, "net/xt_qtaguid/iface_stat/rmnet0/rx_bytes")); + stageLong(20L, new File(mTestProc, "net/xt_qtaguid/iface_stat/rmnet0/rx_packets")); + stageLong(30L, new File(mTestProc, "net/xt_qtaguid/iface_stat/rmnet0/tx_bytes")); + stageLong(40L, new File(mTestProc, "net/xt_qtaguid/iface_stat/rmnet0/tx_packets")); + + final NetworkStats stats = mService.getNetworkStatsSummary(); + assertStatsEntry(stats, "rmnet0", UID_ALL, SET_DEFAULT, TAG_NONE, 1507570L + 10L, + 2205L + 20L, 489339L + 30L, 2237L + 40L); + } + public void testKernelTags() throws Exception { assertEquals("0", tagToKernel(0x0)); assertEquals("214748364800", tagToKernel(0x32)); |