to top
public static class

CpuStatsCollector.CpuStats

extends Object
java.lang.Object
   ↳ com.android.tradefed.device.CpuStatsCollector.CpuStats

Class Overview

Class for holding parsed output data for a single cpustats output.

This class holds parsed output, and also performs simple calculations on that data. The methods which perform these calucations should only be called after the object has been populated.

Summary

Fields
public Map<Integer, Integer> mFreqStats
public Map<CpuStatsCollector.TimeCategory, Integer> mTimeStats
Public Constructors
CpuStatsCollector.CpuStats()
Public Methods
Double getEstimatedMhz()
Estimate the MHz used by the cpu during the duration.
Double getPercentage(CpuStatsCollector.TimeCategory category)
Get the percentage of cycles used on a given category.
Double getUsedMhzPercentage()
Get the amount of MHz as a percentage of available MHz used by the cpu during the duration.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public Map<Integer, Integer> mFreqStats

public Map<CpuStatsCollector.TimeCategory, Integer> mTimeStats

Public Constructors

public CpuStatsCollector.CpuStats ()

Public Methods

public Double getEstimatedMhz ()

Estimate the MHz used by the cpu during the duration.

This is calculated by:

((sum(c_time) - idle) / sum(c_time)) * (sum(freq * f_time) / sum(f_time))

where c_time is the time for a given category, idle is the time in the idle state, freq is a frequency and f_time is the time spent in that frequency.

public Double getPercentage (CpuStatsCollector.TimeCategory category)

Get the percentage of cycles used on a given category.

public Double getUsedMhzPercentage ()

Get the amount of MHz as a percentage of available MHz used by the cpu during the duration.

This is calculated by:

100 * sum(freq * f_time) / (max_freq * sum(f_time))

where freq is a frequency, f_time is the time spent in that frequency, and max_freq is the maximum frequency the cpu is capable of.