IT. Expert System.

Android Reference

NetworkStats


android.net

Class NetworkStats

  • All Implemented Interfaces:
    Parcelable


    public class NetworkStats
    extends Object
    implements Parcelable
    Collection of active network statistics. Can contain summary details across all interfaces, or details with per-UID granularity. Internally stores data as a large table, closely matching /proc/ data format. This structure optimizes for rapid in-memory comparison, but consider using NetworkStatsHistory when persisting.
    • Constructor Detail

      • NetworkStats

        public NetworkStats(long elapsedRealtime,
                    int initialSize)
      • NetworkStats

        public NetworkStats(Parcel parcel)
    • Method Detail

      • clone

        public NetworkStats clone()
        Description copied from class: Object
        Creates and returns a copy of this Object. The default implementation returns a so-called "shallow" copy: It creates a new instance of the same class and then copies the field values (including object references) from this instance to the new instance. A "deep" copy, in contrast, would also recursively clone nested objects. A subclass that needs to implement this kind of cloning should call super.clone() to create the new instance and then create deep copies of the nested, mutable objects.
        Overrides:
        clone in class Object
        Returns:
        a copy of this object.
      • addIfaceValues

        public NetworkStats addIfaceValues(String iface,
                                  long rxBytes,
                                  long rxPackets,
                                  long txBytes,
                                  long txPackets)
      • addValues

        public NetworkStats addValues(String iface,
                             int uid,
                             int set,
                             int tag,
                             long rxBytes,
                             long rxPackets,
                             long txBytes,
                             long txPackets,
                             long operations)
      • addValues

        public NetworkStats addValues(NetworkStats.Entry entry)
        Add new stats entry, copying from given IdentityHashMap.Entry. The IdentityHashMap.Entry object can be recycled across multiple calls.
      • getElapsedRealtime

        public long getElapsedRealtime()
      • size

        public int size()
      • internalSize

        public int internalSize()
      • combineValues

        @Deprecated
        public NetworkStats combineValues(String iface,
                                            int uid,
                                            int tag,
                                            long rxBytes,
                                            long rxPackets,
                                            long txBytes,
                                            long txPackets,
                                            long operations)
        Deprecated.
      • combineValues

        public NetworkStats combineValues(String iface,
                                 int uid,
                                 int set,
                                 int tag,
                                 long rxBytes,
                                 long rxPackets,
                                 long txBytes,
                                 long txPackets,
                                 long operations)
      • combineAllValues

        public void combineAllValues(NetworkStats another)
        Combine all values from another NetworkStats into this object.
      • findIndex

        public int findIndex(String iface,
                    int uid,
                    int set,
                    int tag)
        Find first stats index that matches the requested parameters.
      • findIndexHinted

        public int findIndexHinted(String iface,
                          int uid,
                          int set,
                          int tag,
                          int hintIndex)
        Find first stats index that matches the requested parameters, starting search around the hinted index as an optimization.
      • getUniqueIfaces

        public String[] getUniqueIfaces()
        Return list of unique interfaces known by this data structure.
      • getUniqueUids

        public int[] getUniqueUids()
        Return list of unique UIDs known by this data structure.
      • getTotalBytes

        public long getTotalBytes()
        Return total bytes represented by this snapshot object, usually used when checking if a subtract(NetworkStats) delta passes a threshold.
      • subtract

        public NetworkStats subtract(NetworkStats right)
        Subtract the given NetworkStats, effectively leaving the delta between two snapshots in time. Assumes that statistics rows collect over time, and that none of them have disappeared.
      • groupedByIface

        public NetworkStats groupedByIface()
        Return total statistics grouped by iface; doesn't mutate the original structure.
      • groupedByUid

        public NetworkStats groupedByUid()
        Return total statistics grouped by uid; doesn't mutate the original structure.
      • withoutUids

        public NetworkStats withoutUids(int[] uids)
        Return all rows except those attributed to the requested UID; doesn't mutate the original structure.
      • setToString

        public static String setToString(int set)
        Return text description of set value.
      • tagToString

        public static String tagToString(int tag)
        Return text description of tag value.
      • toString

        public String toString()
        Description copied from class: Object
        Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
           getClass().getName() + '@' + Integer.toHexString(hashCode())

        See Writing a useful toString method if you intend implementing your own toString method.

        Overrides:
        toString in class Object
        Returns:
        a printable representation of this object.
      • describeContents

        public int describeContents()
        Description copied from interface: Parcelable
        Describe the kinds of special objects contained in this Parcelable's marshalled representation.
        Specified by:
        describeContents in interface Parcelable
        Returns:
        a bitmask indicating the set of special object types marshalled by the Parcelable.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 739 / 248551110. Delta: 0.02881 с