DeviceTraceCollector

public class DeviceTraceCollector
extends BaseDeviceMetricCollector

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


Collector that will start perfetto trace when a test run starts and log trace file at the end.

Summary

Public constructors

DeviceTraceCollector()

Public methods

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

Callback when a test case is ended.

void onTestRunEnd(DeviceMetricData runData, currentRunMetrics)

Callback when a test run is ended.

void onTestStart(DeviceMetricData testData)

Callback when a test case is started.

void rebootEnded(ITestDevice device)

Gets notification when the reboot ended in device.

void rebootStarted(ITestDevice device)

Gets notification when reboot started in device.

void setInstrumentationPkgName(String packageName)

Public constructors

DeviceTraceCollector

public DeviceTraceCollector ()

Public methods

extraInit

public void extraInit (IInvocationContext context, 
                ITestInvocationListener listener)

Throws
DeviceNotAvailableException

onTestEnd

public void onTestEnd (DeviceMetricData testData, 
                 currentTestCaseMetrics)

Callback when a test case is ended. This should be the time for clean up.

Parameters
testData DeviceMetricData: the DeviceMetricData holding the data for the test case. Will be the same object as during onTestStart(com.android.tradefed.device.metric.DeviceMetricData).

currentTestCaseMetrics : the current map of metrics passed to ERROR(/#testEnded(com.android.tradefed.result.TestDescription,Map)).

Throws
DeviceNotAvailableException

onTestRunEnd

public void onTestRunEnd (DeviceMetricData runData, 
                 currentRunMetrics)

Callback when a test run is ended. This should be the time for clean up.

Parameters
runData DeviceMetricData: the DeviceMetricData holding the data for the run. Will be the same object as during BaseDeviceMetricCollector.onTestRunStart(com.android.tradefed.device.metric.DeviceMetricData).

currentRunMetrics : the current map of metrics passed to ERROR(/#testRunEnded(long,Map)).

Throws
DeviceNotAvailableException

onTestStart

public void onTestStart (DeviceMetricData testData)

Callback when a test case is started.

Parameters
testData DeviceMetricData: the DeviceMetricData holding the data for the test case.

Throws
DeviceNotAvailableException

rebootEnded

public void rebootEnded (ITestDevice device)

Gets notification when the reboot ended in device.

NOTE: Receivers should avoid rebooting during this callback. Any reboot attempt will be ignored.

Parameters
device ITestDevice: ITestDevice where the reboot ended.

Throws
DeviceNotAvailableException

rebootStarted

public void rebootStarted (ITestDevice device)

Gets notification when reboot started in device.

NOTE: Receivers should avoid rebooting during this callback. Any reboot attempt will be ignored.

Parameters
device ITestDevice: ITestDevice where the reboot started.

Throws
DeviceNotAvailableException

setInstrumentationPkgName

public void setInstrumentationPkgName (String packageName)

Parameters
packageName String