ITestProfiler

public interface ITestProfiler

com.android.tradefed.profiler.ITestProfiler
Known Indirect Subclasses
AggregatingProfiler An ITestProfiler which handles aggregating metrics across multiple devices and test runs. 
IAggregatingTestProfiler An ITestProfiler which handles aggregating metrics across multiple devices and test runs. 
StubTestProfiler A stubbed ITestProfiler which does nothing. 


Collects metrics about the device to be made available to ITestInvocationListeners.

In addition to collecting metrics, implementers can define background work to be done, which is intended to simulate specific resource consumption conditions on the device.

Summary

Public methods

abstract void reportAllMetrics(ITestInvocationListener listener)

Send all of the metrics recorded by this profiler to an ITestInvocationListener.

abstract void setUp(IInvocationContext context)

Set up the test profiler.

abstract void startRecordingMetrics()

Begins recording metrics for a single test on all devices.

abstract Map<String, Double> stopRecordingMetrics(TestIdentifier test)

Stops recording metrics for a single test on all devices and returns an aggregated version of the metrics.

Public methods

reportAllMetrics

void reportAllMetrics (ITestInvocationListener listener)

Send all of the metrics recorded by this profiler to an ITestInvocationListener.

Parameters
listener ITestInvocationListener: the listener to send metrics to.

setUp

void setUp (IInvocationContext context)

Set up the test profiler.

Parameters
context IInvocationContext: the IInvocationContext of the test invocation.
Throws
DeviceNotAvailableException

startRecordingMetrics

void startRecordingMetrics ()

Begins recording metrics for a single test on all devices. This method is called on each call to testStarted(TestIdentifier).

Throws
DeviceNotAvailableException

stopRecordingMetrics

Map<String, Double> stopRecordingMetrics (TestIdentifier test)

Stops recording metrics for a single test on all devices and returns an aggregated version of the metrics. The metrics are aggregated with getMergeFunction(String). This method is called on each call to testEnded(TestIdentifier, Map).

Parameters
test TestIdentifier: the test to stop recording on
Returns
Map<String, Double> a Map containing the metrics.
Throws
DeviceNotAvailableException