SimplePerfUtil
public class SimplePerfUtil
extends Object
java.lang.Object | |
↳ | com.android.tradefed.util.SimplePerfUtil |
用于发送简单命令并收集结果的实用程序类
也可以看看:
概括
嵌套类 | |
---|---|
enum | SimplePerfUtil.SimplePerfType simpleperf 命令选项的枚举 |
公共方法 | |
---|---|
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 : IShellOutputReceiver 对象,用于将 shell 输出定向到 |
maxTimeToOutputShellResponse | long :允许命令不输出任何响应的最长时间; timeUnit 中指定的单位 |
timeUnit | TimeUnit : maxTimeToOutputShellResponse 的maxTimeToOutputShellResponse 单位,参见ERROR(/TimeUnit) |
retryAttempts | int :如果由于异常而失败,则重试命令的最大次数。如果retryAttempts未成功执行,将抛出 DeviceNotResponsiveException。 |
投掷 | |
---|---|
DeviceNotAvailableException | 如果与设备的连接丢失且无法恢复 |
执行命令
public void executeCommand (String command, IShellOutputReceiver receiver)
执行给定的 adb shell 命令,并带有 simpleperf
通过接收者解析 simpleperf 结果是调用者的责任参数 | |
---|---|
command | String : 在设备上运行的命令 |
receiver | IShellOutputReceiver : IShellOutputReceiver 对象,用于将 shell 输出定向到 |
投掷 | |
---|---|
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 |
受保护的方法
commandStringPreparer
protected String commandStringPreparer (String command)
参数 | |
---|---|
command | String |
退货 | |
---|---|
String |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2022-07-06 UTC.
[]
[]