Parse network stats using native code.

Switch to parsing detailed network stats with native code, which
is 71% faster than ProcFileReader.

Change-Id: I2525aaee74d227ce187ba3a74dd08a2b06514deb
This commit is contained in:
Jeff Sharkey
2013-01-14 16:48:51 -08:00
parent 805bdac0a0
commit 51c819c4ea
3 changed files with 260 additions and 23 deletions

View File

@@ -135,6 +135,18 @@ public class NetworkStats implements Parcelable {
builder.append(" operations=").append(operations);
return builder.toString();
}
@Override
public boolean equals(Object o) {
if (o instanceof Entry) {
final Entry e = (Entry) o;
return uid == e.uid && set == e.set && tag == e.tag && rxBytes == e.rxBytes
&& rxPackets == e.rxPackets && txBytes == e.txBytes
&& txPackets == e.txPackets && operations == e.operations
&& iface.equals(e.iface);
}
return false;
}
}
public NetworkStats(long elapsedRealtime, int initialSize) {