自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
ResourceMetricUtil
public
class
ResourceMetricUtil
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.monitoring.collector.ResourceMetricUtil
|
用于组合指标的实用函数。
摘要
公共构造函数
ResourceMetricUtil
public ResourceMetricUtil ()
公共方法
ConvertedMetricValue
public static float ConvertedMetricValue (String original,
float conversionDivisor)
将指标值转换为其他单位并设置输出值的格式。
参数 |
original |
String :原始值字符串。 |
conversionDivisor |
float :单位转换的分母。 |
抛出 |
NumberFormatException |
如果原始字符串为 null。 |
GetCommandResponse
public static GetCommandResponse (IDeviceManager deviceManager,
String serial,
String cmd,
long timeoutMs)
执行 adb 命令,并在成功时返回响应。
参数 |
deviceManager |
IDeviceManager :用于在“可用”设备上执行命令的 IDeviceManager 实例。 |
serial |
String :设备序列号。 |
cmd |
String :命令字符串。 |
timeoutMs |
long :等待时间(以毫秒为单位)。 |
GetCurrentTimestamp
public static Timestamp GetCurrentTimestamp ()
从系统 UTC 时钟获取当前时间戳。
RoundedMetricValue
public static float RoundedMetricValue (String original)
解析和格式化指标值。
参数 |
original |
String :原始值字符串。 |
抛出 |
NumberFormatException |
如果原始字符串为 null。 |
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-26。
[null,null,["最后更新时间 (UTC):2025-03-26。"],[],[]]