ScheduleMultipleDeviceMetricCollector

public class ScheduleMultipleDeviceMetricCollector
extends BaseDeviceMetricCollector

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


A IMetricCollector that makes runs multiple metric collectors periodically. This is a best effort scheduler. It makes the best effort to run the collectors at given intervals while making sure that no two collectors are run at the same time.

Summary

Public constructors

ScheduleMultipleDeviceMetricCollector()

Public methods

ITestInvocationListener init(IInvocationContext context, ITestInvocationListener listener)

Initialization of the collector with the current context and where to forward results.

final void onTestRunEnd(DeviceMetricData runData, Map<String, MetricMeasurement.Metric> currentRunMetrics)

Callback when a test run is ended.

final void onTestRunStart(DeviceMetricData runData)

Callback when a test run is started.

Public constructors

ScheduleMultipleDeviceMetricCollector

public ScheduleMultipleDeviceMetricCollector ()

Public methods

init

public ITestInvocationListener init (IInvocationContext context, 
                ITestInvocationListener listener)

Initialization of the collector with the current context and where to forward results. Will only be called once per instance, and the collector is expected to update its internal context and listener. Init will never be called during a test run always before.

Do not override unless you know what you are doing.

Parameters
context IInvocationContext: the IInvocationContext for the invocation in progress.

listener ITestInvocationListener: the ITestInvocationListener where to put results.

Returns
ITestInvocationListener the new listener wrapping the original one.

onTestRunEnd

public final void onTestRunEnd (DeviceMetricData runData, 
                Map<String, MetricMeasurement.Metric> 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 onTestRunStart(DeviceMetricData).

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

onTestRunStart

public final void onTestRunStart (DeviceMetricData runData)

Callback when a test run is started.

Parameters
runData DeviceMetricData: the DeviceMetricData holding the data for the run.