SimplePerfUtil

public class SimplePerfUtil
extends Object

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


調度簡易指令及收集結果的公用程式類別

另請參閱:

摘要

巢狀類別

enum SimplePerfUtil.SimplePerfType

Simpleperf 指令選項列舉

公用方法

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)

公用方法

執行指令

public SimplePerfResult executeCommand (String command)

執行指定 ADB 殼層指令,並以 Simpleperf 括住

Simpleperf 結果會經過剖析,並傳回呼叫端

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

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

擲回
DeviceNotAvailableException 導致與裝置之間的連線中斷且無法 已復原

執行指令

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

執行指定 ADB 殼層指令,並以 Simpleperf 括住

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

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

receiver IShellOutputReceiver:將殼層輸出內容導向的 IShellOutputReceiver 物件

maxTimeToOutputShellResponse long:指令執行的時間長度上限 不允許輸出任何回應;timeUnit 中指定的單位

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

retryAttempts int:如果指令失敗而導致重試失敗的次數上限, 例外狀況。如果 retryAttempts 發生 卻未成功執行

擲回
DeviceNotAvailableException 導致與裝置之間的連線中斷且無法 已復原

執行指令

public void executeCommand (String command, 
                IShellOutputReceiver receiver)

執行指定 ADB 殼層指令,並以 Simpleperf 括住

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

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

receiver IShellOutputReceiver:將殼層輸出內容導向的 IShellOutputReceiver 物件

擲回
DeviceNotAvailableException 導致與裝置之間的連線中斷且無法 已復原

getArgumentList

public  getArgumentList ()

取得 Simpleperf 指令的引數

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

新執行個體

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 :子指令和引數的清單

保護方法

指令字串 Preparer

protected String commandStringPreparer (String command)

參數
command String

傳回
String