public class NetworkStatsCollection extends Object implements FileRotator.Reader
NetworkStatsHistory
, stored based on combined key of
NetworkIdentitySet
, UID, set, and tag. Knows how to persist itself.Constructor and Description |
---|
NetworkStatsCollection(long bucketDuration) |
Modifier and Type | Method and Description |
---|---|
void |
clearDirty() |
void |
dump(IndentingPrintWriter pw) |
void |
dumpCheckin(PrintWriter pw,
long start,
long end) |
long |
getEndMillis() |
long |
getFirstAtomicBucketMillis()
Return first atomic bucket in this collection, which is more conservative
than
mStartMillis . |
NetworkStatsHistory |
getHistory(NetworkTemplate template,
int uid,
int set,
int tag,
int fields,
int accessLevel)
Combine all
NetworkStatsHistory in this collection which match
the requested parameters. |
NetworkStatsHistory |
getHistory(NetworkTemplate template,
int uid,
int set,
int tag,
int fields,
long start,
long end,
int accessLevel)
Combine all
NetworkStatsHistory in this collection which match
the requested parameters. |
NetworkStatsHistory |
getHistory(NetworkTemplate template,
int uid,
int set,
int tag,
int fields,
long start,
long end,
int accessLevel,
int callerUid)
Combine all
NetworkStatsHistory in this collection which match
the requested parameters. |
int[] |
getRelevantUids(int accessLevel) |
int[] |
getRelevantUids(int accessLevel,
int callerUid) |
long |
getStartMillis() |
NetworkStats |
getSummary(NetworkTemplate template,
long start,
long end,
int accessLevel)
Summarize all
NetworkStatsHistory in this collection which match
the requested parameters. |
NetworkStats |
getSummary(NetworkTemplate template,
long start,
long end,
int accessLevel,
int callerUid)
Summarize all
NetworkStatsHistory in this collection which match
the requested parameters. |
long |
getTotalBytes() |
boolean |
isDirty() |
boolean |
isEmpty() |
void |
read(DataInputStream in) |
void |
read(InputStream in) |
void |
readLegacyNetwork(File file)
Deprecated.
|
void |
readLegacyUid(File file,
boolean onlyTags)
Deprecated.
|
void |
recordCollection(NetworkStatsCollection another)
Record all
NetworkStatsHistory contained in the given collection
into this collection. |
void |
recordData(NetworkIdentitySet ident,
int uid,
int set,
int tag,
long start,
long end,
NetworkStats.Entry entry)
Record given
NetworkStats.Entry into this collection. |
void |
removeUids(int[] uids)
Remove any
NetworkStatsHistory attributed to the requested UID,
moving any NetworkStats.TAG_NONE series to
TrafficStats.UID_REMOVED . |
void |
reset() |
void |
write(DataOutputStream out) |
public void reset()
public long getStartMillis()
public long getFirstAtomicBucketMillis()
mStartMillis
.public long getEndMillis()
public long getTotalBytes()
public boolean isDirty()
public void clearDirty()
public boolean isEmpty()
public int[] getRelevantUids(int accessLevel)
public int[] getRelevantUids(int accessLevel, int callerUid)
public NetworkStatsHistory getHistory(NetworkTemplate template, int uid, int set, int tag, int fields, int accessLevel)
NetworkStatsHistory
in this collection which match
the requested parameters.public NetworkStatsHistory getHistory(NetworkTemplate template, int uid, int set, int tag, int fields, long start, long end, int accessLevel)
NetworkStatsHistory
in this collection which match
the requested parameters.public NetworkStatsHistory getHistory(NetworkTemplate template, int uid, int set, int tag, int fields, long start, long end, int accessLevel, int callerUid)
NetworkStatsHistory
in this collection which match
the requested parameters.public NetworkStats getSummary(NetworkTemplate template, long start, long end, int accessLevel)
NetworkStatsHistory
in this collection which match
the requested parameters.public NetworkStats getSummary(NetworkTemplate template, long start, long end, int accessLevel, int callerUid)
NetworkStatsHistory
in this collection which match
the requested parameters.public void recordData(NetworkIdentitySet ident, int uid, int set, int tag, long start, long end, NetworkStats.Entry entry)
NetworkStats.Entry
into this collection.public void recordCollection(NetworkStatsCollection another)
NetworkStatsHistory
contained in the given collection
into this collection.public void read(InputStream in) throws IOException
read
in interface FileRotator.Reader
IOException
public void read(DataInputStream in) throws IOException
IOException
public void write(DataOutputStream out) throws IOException
IOException
@Deprecated public void readLegacyNetwork(File file) throws IOException
IOException
@Deprecated public void readLegacyUid(File file, boolean onlyTags) throws IOException
IOException
public void removeUids(int[] uids)
NetworkStatsHistory
attributed to the requested UID,
moving any NetworkStats.TAG_NONE
series to
TrafficStats.UID_REMOVED
.public void dump(IndentingPrintWriter pw)
public void dumpCheckin(PrintWriter pw, long start, long end)