CpuStatsCollector.CpuStats
public
static
class
CpuStatsCollector.CpuStats
extends Object
java.lang.Object | |
↳ | com.android.tradefed.device.CpuStatsCollector.CpuStats |
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
|
mFreqStats
|
public
|
mTimeStats
|
Public constructors | |
---|---|
CpuStatsCollector.CpuStats()
|
Public methods | |
---|---|
Double
|
getEstimatedMhz()
Estimate the MHz used by the cpu during the duration. |
Double
|
getPercentage(com.android.tradefed.device.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. |
Fields
mFreqStats
publicmFreqStats
mTimeStats
publicmTimeStats
Public constructors
CpuStatsCollector.CpuStats
public CpuStatsCollector.CpuStats ()
Public methods
getEstimatedMhz
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.
Returns | |
---|---|
Double |
getPercentage
public Double getPercentage (com.android.tradefed.device.CpuStatsCollector.TimeCategory category)
Get the percentage of cycles used on a given category.
Parameters | |
---|---|
category |
com.android.tradefed.device.CpuStatsCollector.TimeCategory |
Returns | |
---|---|
Double |
getUsedMhzPercentage
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.
Returns | |
---|---|
Double |