SimplePerfUtil

public class SimplePerfUtil
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.SimplePerfUtil


用於調度簡單指令及收集結果的工具類別

另請參閱:

摘要

公用方法

SimplePerfResult executeCommand(String command)

執行指定的 ADB 殼層指令,並在其中包裝 simpleperf

Simpleperf 結果會解析並傳回給呼叫端

void executeCommand(String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)

執行指定的 ADB 殼層指令,並在其中包裝 simpleperf

呼叫端有責任透過接收器剖析 Simpleperf 結果

void executeCommand(String command, IShellOutputReceiver receiver)

執行指定的 ADB 殼層指令,並在其中包裝 simpleperf

呼叫端有責任透過接收器剖析 Simpleperf 結果

getArgumentList()

取得 Simpleperf 指令的引數

static SimplePerfUtil newInstance(ITestDevice device, SimplePerfUtil.SimplePerfType type)

SimplePerfUtil 建構函式

呼叫端在初始化執行個體時,必須定義裝置和 Simpleperf 類型

void setArgumentList( arguList)

在 Simpleperf 指令上設定引數

受保護的方法

String commandStringPreparer(String command)

公用方法

executeCommand

public SimplePerfResult executeCommand (String command)

執行指定的 ADB 殼層指令,並在其中包裝 simpleperf

Simpleperf 結果會解析並傳回給呼叫端

參數
command String:在裝置上執行的指令

傳回
SimplePerfResult SimplePerfResult 物件包含所有結果資訊

擲回
DeviceNotAvailableException 如果與裝置的連線中斷且無法復原

executeCommand

public void executeCommand (String command, 
                IShellOutputReceiver receiver, 
                long maxTimeToOutputShellResponse, 
                TimeUnit timeUnit, 
                int retryAttempts)

執行指定的 ADB 殼層指令,並在其中包裝 simpleperf

呼叫端有責任透過接收器剖析 simpleperf 結果

參數
command String:在裝置上執行的指令

receiver IShellOutputReceiverIShellOutputReceiver 物件,用於將殼層輸出內容導向至

maxTimeToOutputShellResponse long:指令允許不輸出任何回應的時間上限;單位如 timeUnit 所指定

timeUnit TimeUnitmaxTimeToOutputShellResponse 的時間單位,請參閱 ERROR(/TimeUnit)

retryAttempts int:如果指令因例外狀況而失敗,則重試指令的次數上限。如果執行 retryAttempts 失敗,系統會擲回 DeviceNotResponsiveException。

擲回
DeviceNotAvailableException 如果與裝置的連線中斷且無法復原

executeCommand

public void executeCommand (String command, 
                IShellOutputReceiver receiver)

執行指定的 ADB 殼層指令,並在其中包裝 simpleperf

呼叫端有責任透過接收器剖析 simpleperf 結果

參數
command String:在裝置上執行的指令

receiver IShellOutputReceiverIShellOutputReceiver 物件,用於將殼層輸出內容導向至

擲回
DeviceNotAvailableException 如果與裝置的連線中斷且無法復原

getArgumentList

public  getArgumentList ()

取得 Simpleperf 指令的引數

傳回
子指令和引數清單 (可為空值)

newInstance

public static SimplePerfUtil newInstance (ITestDevice device, 
                SimplePerfUtil.SimplePerfType type)

SimplePerfUtil 建構函式

呼叫端在初始化執行個體時,必須定義裝置和 Simpleperf 類型

參數
device ITestDeviceITestDevice 測試裝置

type SimplePerfUtil.SimplePerfTypeSimplePerfType 會指出要使用哪種 Simpleperf 模式

傳回
SimplePerfUtil 新建立的 SimplePerfUtil 例項

setArgumentList

public void setArgumentList ( arguList)

在 Simpleperf 指令上設定引數

參數
arguList :子指令和引數清單

受保護的方法

commandStringPreparer

protected String commandStringPreparer (String command)

參數
command String

傳回
String