MetricsXMLResultReporter

public class MetricsXMLResultReporter
extends CollectingTestListener

java.lang.Object
   ↳ com.android.tradefed.result.CollectingTestListener
     ↳ com.android.tradefed.result.MetricsXMLResultReporter


MetricsXMLResultReporter 會在測試的 invocationEnded 階段,將測試指標和執行指標寫入由 metrics-folder 參數指定的資料夾中 XML 檔案。XML 檔案會傳送至演算法,以便偵測回歸。

執行指標地圖中的所有 k-v 對會以以下格式呈現: 並放在 標記下方

執行指標對應表中的所有鍵/值對會以以下格式呈現: ,並放在 標記下方,該標記會嵌套在 下方。

XML 格式範例:

摘要

公用建構函式

MetricsXMLResultReporter()

公用方法

OutputStream createOutputStream()
String getTimeStamp()

將目前的時間戳記傳回為 String

void invocationEnded(long elapsedTime)

回報叫用已終止,無論是成功或因某些錯誤條件而終止。

公用建構函式

MetricsXMLResultReporter

public MetricsXMLResultReporter ()

公用方法

createOutputStream

public OutputStream createOutputStream ()

傳回
OutputStream

getTimeStamp

public String getTimeStamp ()

將目前的時間戳記傳回為 String

傳回
String

invocationEnded

public void invocationEnded (long elapsedTime)

回報叫用已終止,無論是成功或因某些錯誤條件而終止。

會由 TradeFederation 架構自動呼叫。

參數
elapsedTime long:叫用作業的經過時間 (以毫秒為單位)