簡單效能工具
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) setArgumentList ( arguList) 在 simpleperf 指令上設定參數 |
受保護的方法 | |
---|---|
String | commandStringPreparer (String command) |
公共方法
執行命令
public SimplePerfResult executeCommand (String command)
執行給定的 adb shell 指令,並包含 simpleperf
Simpleperf 結果將會被解析並傳回給呼叫者參數 | |
---|---|
command | String : 在裝置上執行的命令 |
退貨 | |
---|---|
SimplePerfResult | SimplePerfResult 物件包含所有結果訊息 |
投擲 | |
---|---|
DeviceNotAvailableException | 如果與裝置的連線遺失且無法恢復 |
執行命令
public void executeCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
執行給定的 adb shell 指令,並包含 simpleperf
呼叫者有責任透過接收者解析 simpleperf 結果參數 | |
---|---|
command | String : 在裝置上執行的命令 |
receiver | IShellOutputReceiver :將 shell 輸出導向的IShellOutputReceiver 對象 |
maxTimeToOutputShellResponse | long :允許指令不輸出任何回應的最長時間; timeUnit 中指定的單位 |
timeUnit | TimeUnit : maxTimeToOutputShellResponse 的時間單位,請參閱ERROR(/TimeUnit) |
retryAttempts | int :如果因為異常而失敗,重試指令的最大次數。如果執行retryAttempts沒有成功,將會拋出 DeviceNotResponsiveException。 |
投擲 | |
---|---|
DeviceNotAvailableException | 如果與裝置的連線遺失且無法恢復 |
執行命令
public void executeCommand (String command, IShellOutputReceiver receiver)
執行給定的 adb shell 指令,並包含 simpleperf
呼叫者有責任透過接收者解析 simpleperf 結果參數 | |
---|---|
command | String : 在裝置上執行的命令 |
receiver | IShellOutputReceiver :將 shell 輸出導向的IShellOutputReceiver 對象 |
投擲 | |
---|---|
DeviceNotAvailableException | 如果與裝置的連線遺失且無法恢復 |
取得參數列表
publicgetArgumentList ()
取得 simpleperf 指令的參數
退貨 | |
---|---|
子命令和參數列表(可為空) |
新實例
public static SimplePerfUtil newInstance (ITestDevice device, SimplePerfUtil.SimplePerfType type)
SimplePerfUtil 建構子
呼叫者在初始化實例時必須定義裝置和 simpleperf 類型參數 | |
---|---|
device | ITestDevice : ITestDevice 測試設備 |
type | SimplePerfUtil.SimplePerfType : SimplePerfType 指示哪一種 simpleperf 模式 |
退貨 | |
---|---|
SimplePerfUtil | 新建的 SimplePerfUtil 實例 |
設定參數列表
public void setArgumentList (arguList)
在 simpleperf 指令上設定參數
參數 | |
---|---|
arguList |
受保護的方法
命令字串準備器
protected String commandStringPreparer (String command)
參數 | |
---|---|
command | String |
退貨 | |
---|---|
String |