SimplePerfUtil

public class SimplePerfUtil
extends Object

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


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

另請參閱:

摘要

公用方法

SimplePerfResult executeCommand(String command)

執行指定的 adb shell 指令,同時一併使用 simpleperf 進行效能分析

系統會剖析 Simpleperf 結果,並傳回給呼叫端

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

執行指定的 adb shell 指令,同時一併使用 simpleperf 進行效能分析

呼叫端必須透過接收器剖析 simpleperf 結果

void executeCommand(String command, IShellOutputReceiver receiver)

執行指定的 adb shell 指令,同時一併使用 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 shell 指令,同時一併使用 simpleperf 進行效能分析

系統會剖析 Simpleperf 結果,並傳回給呼叫端

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

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

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

executeCommand

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

執行指定的 adb shell 指令,同時一併使用 simpleperf 進行效能分析

呼叫端必須透過接收器剖析 simpleperf 結果

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

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

maxTimeToOutputShellResponse long:指令在允許不輸出任何回應時,可經過的最長時間;單位如 timeUnit 中所指定

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

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

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

executeCommand

public void executeCommand (String command, 
                IShellOutputReceiver receiver)

執行指定的 adb shell 指令,同時一併使用 simpleperf 進行效能分析

呼叫端必須透過接收器剖析 simpleperf 結果

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

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

擲回
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