Merge changes from topic "bpfStats" am: e339107631

am: a0b44c329f

Change-Id: Ib4790159fd331858ce9f3343a44ccec66fae638c
This commit is contained in:
Chenbo Feng
2018-01-24 05:39:54 +00:00
committed by android-build-merger
2 changed files with 23 additions and 1 deletions

View File

@@ -67,7 +67,7 @@ public class NetworkStatsFactoryTest {
IoUtils.deleteContents(mTestProc);
}
mFactory = new NetworkStatsFactory(mTestProc);
mFactory = new NetworkStatsFactory(mTestProc, false);
}
@After
@@ -115,6 +115,20 @@ public class NetworkStatsFactoryTest {
assertStatsEntry(stats, "rmnet1", 10021, SET_FOREGROUND, 0x30100000, 742L, 3L, 1265L, 3L);
}
@Test
public void testNetworkStatsSummary() throws Exception {
stageFile(R.raw.net_dev_typical, file("net/dev"));
final NetworkStats stats = mFactory.readNetworkStatsIfaceDev();
assertEquals(6, stats.size());
assertStatsEntry(stats, "lo", UID_ALL, SET_ALL, TAG_NONE, 8308L, 8308L);
assertStatsEntry(stats, "rmnet0", UID_ALL, SET_ALL, TAG_NONE, 1507570L, 489339L);
assertStatsEntry(stats, "ifb0", UID_ALL, SET_ALL, TAG_NONE, 52454L, 0L);
assertStatsEntry(stats, "ifb1", UID_ALL, SET_ALL, TAG_NONE, 52454L, 0L);
assertStatsEntry(stats, "sit0", UID_ALL, SET_ALL, TAG_NONE, 0L, 0L);
assertStatsEntry(stats, "ip6tnl0", UID_ALL, SET_ALL, TAG_NONE, 0L, 0L);
}
@Test
public void testNetworkStatsSingle() throws Exception {
stageFile(R.raw.xt_qtaguid_iface_typical, file("net/xt_qtaguid/iface_stat_all"));

View File

@@ -0,0 +1,8 @@
Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
lo: 8308 116 0 0 0 0 0 0 8308 116 0 0 0 0 0 0
rmnet0: 1507570 2205 0 0 0 0 0 0 489339 2237 0 0 0 0 0 0
ifb0: 52454 151 0 151 0 0 0 0 0 0 0 0 0 0 0 0
ifb1: 52454 151 0 151 0 0 0 0 0 0 0 0 0 0 0 0
sit0: 0 0 0 0 0 0 0 0 0 0 148 0 0 0 0 0
ip6tnl0: 0 0 0 0 0 0 0 0 0 0 151 151 0 0 0 0