MetricUtils

public final class MetricUtils
extends Object

java.lang.Object
   ↳ com.google.android.tradefed.result.teststorage.MetricUtils


這個類別用於保存處理指標格式轉換的輔助方法。

摘要

公用建構函式

MetricUtils()

公用方法

static convertValueToDouble( tfMetrics)

將 Map<string, metricmeasurement.metric=""> 轉換為 Map<string, double="">。 </string,></string,>

static Metrics toMetrics( tfMetrics)

將指標鍵的 HashMap 對應至 Tradefed 指標,然後轉換為 Android Build API 指標模型。

公用建構函式

MetricUtils

public MetricUtils ()

公用方法

convertValueToDouble

public static  convertValueToDouble ( tfMetrics)

將 Map<string, metricmeasurement.metric=""> 轉換為 Map<string, double="">。系統會保留 int 和 double 的單一值,但不會轉換值清單,且這些值會遺失。</string,></string,>

參數
tfMetrics :指標鍵至 Tradefed 指標的 HashMap

傳回
指標鍵的 HashMap,值為 double

toMetrics

public static Metrics toMetrics ( tfMetrics)

將指標鍵的 HashMap 對應至 Tradefed 指標,然後轉換為 Android Build API Metrics 模型。

參數
tfMetrics :指標鍵至 Tradefed 指標的 HashMap

傳回
Metrics 指標模型