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 |