FileDocCategorySizeDatePackage
NetworkStatsFactoryBenchmark.javaAPI DocAndroid 5.1 API1709Thu Mar 12 22:22:12 GMT 2015com.android.internal.net

NetworkStatsFactoryBenchmark

public class NetworkStatsFactoryBenchmark extends com.google.caliper.SimpleBenchmark

Fields Summary
private File
mStats
Constructors Summary
Methods Summary
protected voidsetUp()

        mStats = new File("/proc/net/xt_qtaguid/stats");
    
protected voidtearDown()

        mStats = null;
    
public voidtimeReadNetworkStatsDetailJava(int reps)

        for (int i = 0; i < reps; i++) {
            NetworkStatsFactory.javaReadNetworkStatsDetail(mStats, NetworkStats.UID_ALL);
        }
    
public voidtimeReadNetworkStatsDetailNative(int reps)

        for (int i = 0; i < reps; i++) {
            final NetworkStats stats = new NetworkStats(SystemClock.elapsedRealtime(), 0);
            NetworkStatsFactory.nativeReadNetworkStatsDetail(
                    stats, mStats.getAbsolutePath(), NetworkStats.UID_ALL);
        }