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) |
公开方法
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 对象,将shell输出定向到 |
maxTimeToOutputShellResponse | long :允许命令不输出任何响应的最long ; timeUnit 指定的timeUnit |
timeUnit | TimeUnit :用于TIMEUNIT单元maxTimeToOutputShellResponse ,见ERROR(/TimeUnit) |
retryAttempts | int :如果命令由于异常而失败的最大重试次数。如果执行retryAttempts没有成功,将引发retryAttempts 。 |
投掷 | |
---|---|
DeviceNotAvailableException | 如果与设备的连接丢失并且无法恢复 |
executeCommand
public void executeCommand (String command, IShellOutputReceiver receiver)
执行给定的adb shell命令,并在其中包裹simpleperf
调用方有责任通过接收方解析simpleperf结果参量 | |
---|---|
command | String :在设备上运行的命令 |
receiver | IShellOutputReceiver : IShellOutputReceiver 对象,将shell输出定向到 |
投掷 | |
---|---|
DeviceNotAvailableException | 如果与设备的连接丢失并且无法恢复 |
getArgumentList
publicgetArgumentList ()
获取simpleperf命令的参数
退货 | |
---|---|
子命令和参数列表(可为空) |
newInstance
public static SimplePerfUtil newInstance (ITestDevice device, SimplePerfUtil.SimplePerfType type)
SimplePerfUtil构造函数
初始化实例时,调用方必须定义设备和simpleperf类型参量 | |
---|---|
device | ITestDevice : ITestDevice 测试设备 |
type | SimplePerfUtil.SimplePerfType : SimplePerfType 指示哪种simpleperf模式 |
退货 | |
---|---|
SimplePerfUtil | 一个新创建的SimplePerfUtil实例 |
setArgumentList
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 is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-09-08 UTC.