使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
TfMetricProtoUtil
public
class
TfMetricProtoUtil
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.util.proto.TfMetricProtoUtil
|
此实用程序类有助于从 Map<string, string=""> 到 Map<string, metric=""> 的转换。</string,></string,>
摘要
公共方法 |
static
|
compatibleConvert( map)
Map<string, metric=""> 转换为 Map<string, string="">.
</string,></string,>
|
static
MetricMeasurement.Metric
|
createSingleValue(long value, String unit)
为单个 long/int 值创建 Metric ,并可选提供单位。
|
static
MetricMeasurement.Metric
|
stringToMetric(String metric)
将简单的字符串指标(旧格式)转换为 Metric (新格式)。
|
static
|
upgradeConvert( metrics)
从 Map<string, string=""> 转换为 HashMap<string, metric="">。
</string,></string,>
|
static
|
upgradeConvert( metrics, boolean smartNumbers)
从 Map<string, string=""> 转换为 HashMap<string, metric="">。
</string,></string,>
|
公共构造函数
TfMetricProtoUtil
public TfMetricProtoUtil ()
公共方法
compatibleConvert
public static compatibleConvert ( map)
将 Map<string, metric=""> 转换为 Map<string, string="">。使用所有单值字符串表示法,不会转换列表表示法,否则会丢失。</string,></string,>
createSingleValue
public static MetricMeasurement.Metric createSingleValue (long value,
String unit)
为单个 long/int 值创建 Metric
,并可选提供单位。
参数 |
value |
long :要存储的值。 |
unit |
String :值的单位,如果没有单位,则为 null。 |
返回 |
MetricMeasurement.Metric |
填充了相关信息的 Metric 。 |
stringToMetric
public static MetricMeasurement.Metric stringToMetric (String metric)
将简单的字符串指标(旧格式)转换为 Metric
(新格式)。
参数 |
metric |
String :包含指标的字符串。 |
返回 |
MetricMeasurement.Metric |
创建的 Metric |
UpgradeConvert
public static upgradeConvert ( metrics)
将 Map<string, string=""> 转换为 HashMap<string, metric="">,以便转到新界面。由于旧格式限制,系统可能只会填充部分信息。</string,></string,>
upgradeConvert
public static upgradeConvert ( metrics,
boolean smartNumbers)
将 Map<string, string=""> 转换为 HashMap<string, metric="">,以便转到新界面。由于旧格式限制,系统可能只会填充部分信息。</string,></string,>
参数 |
metrics |
|
smartNumbers |
boolean :将数字转换为 int 指标 |
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-11-09。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-11-09。"],[],[]]