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) 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 的 timeUnit 單位,參見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 |