ResourceMetricUtil
public
class
ResourceMetricUtil
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.monitoring.collector.ResourceMetricUtil
|
Utility functions for composing metrics.
Summary
Public methods |
static
float
|
ConvertedMetricValue(String original, float conversionDivisor)
Converts the metric value to different units and formats the output value.
|
static
|
GetCommandResponse(IDeviceManager deviceManager, String serial, String cmd, long timeoutMs)
Executes adb command and returns response if succeed.
|
static
Timestamp
|
GetCurrentTimestamp()
Gets current timestamp from system UTC clock.
|
static
float
|
RoundedMetricValue(String original)
Parse and format the metric value.
|
Public constructors
ResourceMetricUtil
public ResourceMetricUtil ()
Public methods
ConvertedMetricValue
public static float ConvertedMetricValue (String original,
float conversionDivisor)
Converts the metric value to different units and formats the output value.
Parameters |
original |
String : the original value string. |
conversionDivisor |
float : the divisor for unit conversion. |
Returns |
float |
The output float value. |
Throws |
NumberFormatException |
if the original string is null. |
GetCommandResponse
public static GetCommandResponse (IDeviceManager deviceManager,
String serial,
String cmd,
long timeoutMs)
Executes adb command and returns response if succeed.
Parameters |
deviceManager |
IDeviceManager : the IDeviceManager instance for executing command on "Available"
devices. |
serial |
String : the device serial. |
cmd |
String : the command string. |
timeoutMs |
long : the time to wait in milliseconds. |
GetCurrentTimestamp
public static Timestamp GetCurrentTimestamp ()
Gets current timestamp from system UTC clock.
RoundedMetricValue
public static float RoundedMetricValue (String original)
Parse and format the metric value.
Parameters |
original |
String : the original value string. |
Returns |
float |
The output float value. |
Throws |
NumberFormatException |
if the original string is null. |