DeviceTraceCollector

public class DeviceTraceCollector
extends BaseDeviceMetricCollector

java.lang.Object
   ↳ com.android.tradefed.device.metric.BaseDeviceMetricCollector
     ↳ com.android.tradefed.device.metric.DeviceTraceCollector


在测试运行开始时启动 perfetto 轨迹并在结束时记录轨迹文件的收集器。

摘要

公共构造函数

DeviceTraceCollector()

公共方法

void extraInit(IInvocationContext context, ITestInvocationListener listener)
void onTestEnd(DeviceMetricData testData, currentTestCaseMetrics)

测试用例结束时的回调。

void onTestRunEnd(DeviceMetricData runData, currentRunMetrics)

测试运行结束时的回调。

void onTestStart(DeviceMetricData testData)

测试用例开始时的回调。

void rebootEnded(ITestDevice device)

在设备重启结束时获取通知。

void rebootStarted(ITestDevice device)

在设备中启动重启时获取通知。

void setInstrumentationPkgName(String packageName)

公共构造函数

DeviceTraceCollector

public DeviceTraceCollector ()

公共方法

extraInit

public void extraInit (IInvocationContext context, 
                ITestInvocationListener listener)

抛出
DeviceNotAvailableException

onTestEnd

public void onTestEnd (DeviceMetricData testData, 
                 currentTestCaseMetrics)

测试用例结束时的回调。现在应该进行清理。

参数
testData DeviceMetricData:用于保存测试用例数据的 DeviceMetricData。将与 onTestStart(com.android.tradefed.device.metric.DeviceMetricData) 期间的对象相同。

currentTestCaseMetrics :传递给 ERROR(/#testEnded(com.android.tradefed.result.TestDescription,Map)) 的当前指标映射。

抛出
DeviceNotAvailableException

onTestRunEnd

public void onTestRunEnd (DeviceMetricData runData, 
                 currentRunMetrics)

测试运行结束时的回调。现在应该进行清理。

参数
runData DeviceMetricData:用于保存运行数据的 DeviceMetricData。与 BaseDeviceMetricCollector.onTestRunStart(com.android.tradefed.device.metric.DeviceMetricData) 期间的对象相同。

currentRunMetrics :传递给 ERROR(/#testRunEnded(long,Map)) 的当前指标映射。

抛出
DeviceNotAvailableException

onTestStart

public void onTestStart (DeviceMetricData testData)

测试用例开始时的回调。

参数
testData DeviceMetricData:用于保存测试用例数据的 DeviceMetricData

抛出
DeviceNotAvailableException

rebootEnded

public void rebootEnded (ITestDevice device)

在设备重启结束时收到通知。

注意:接收器应避免在此回调期间重启。任何重启尝试都会被忽略。

参数
device ITestDevice:重新启动结束时的 ITestDevice

抛出
DeviceNotAvailableException

rebootStarted

public void rebootStarted (ITestDevice device)

在设备中启动重新启动时获取通知。

注意:接收器应避免在此回调期间重启。任何重启尝试都会被忽略。

参数
device ITestDeviceITestDevice,重启开始的位置。

抛出
DeviceNotAvailableException

setInstrumentationPkgName

public void setInstrumentationPkgName (String packageName)

参数
packageName String