简单性能工具

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 TimeUnitmaxTimeToOutputShellResponse的时间单位,请参阅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如果与设备的连接丢失且无法恢复

获取参数列表

public  getArgumentList ()

获取 simpleperf 命令的参数

退货
子命令和参数列表(可为空)

新实例

public static SimplePerfUtil newInstance (ITestDevice device, 
                SimplePerfUtil.SimplePerfType type)

SimplePerfUtil 构造函数

调用者在初始化实例时必须定义设备和 simpleperf 类型

参数
device ITestDeviceITestDevice测试设备

type SimplePerfUtil.SimplePerfTypeSimplePerfType指示哪种 simpleperf 模式

退货
SimplePerfUtil新创建的 SimplePerfUtil 实例

设置参数列表

public void setArgumentList ( arguList)

在 simpleperf 命令上设置参数

参数
arguList :子命令和参数列表

受保护的方法

命令字符串准备器

protected String commandStringPreparer (String command)

参数
command String

退货
String