IMetricCollector
public
interface
IMetricCollector
implements
IDisableable,
ILogSaverListener
com.android.tradefed.device.metric.IMetricCollector |
This interface will be added as a decorator when reporting tests results in order to collect matching metrics.
This interface cannot be used as a Collectors are not expected to keep an internal state as they may be re-used in several
places. If an internal state really must be used, then it should be cleaned on Whether or not the collector is applicable to module level capture and should be init.
Returns the list of build information available in the invocation.
Returns the list of devices available in the invocation.
Returns the original Initialization of the collector with the current context and where to forward results.
Callback when a test case fails with assumption failure.
Callback when a test case is ended.
Callback when a test case is ended.
Callback when a test case fails.
Allows capturing the module ended event.
Allows capturing the module started event.
Callback when a test run is ended.
Callback when a test run is started.
Callback when a test run is started.
Callback when a test case is started.
Whether or not the collector is applicable to module level capture and should be init. Returns the list of build information available in the invocation. Returns the list of devices available in the invocation. Returns the original 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. Callback when a test case fails with assumption failure. Callback when a test case is ended. This should be the time for clean up. Callback when a test case is ended. This should be the time for clean up. Callback when a test case fails. Allows capturing the module ended event. Allows capturing the module started event. Callback when a test run is ended. This should be the time for clean up. Callback when a test run is started. Callback when a test run is started. Callback when a test case is started.ITestInvocationListener
. The configuration checking will reject it. It must be used as a
"metrics_collector".
init(com.android.tradefed.invoker.IInvocationContext, com.android.tradefed.result.ITestInvocationListener)
.Summary
Public methods
default
boolean
captureModuleLevel()
abstract
getBuildInfos()
abstract
getDevices()
abstract
ITestInvocationListener
getInvocationListener()
ITestInvocationListener
where we are forwarding the results.
abstract
ITestInvocationListener
init(IInvocationContext context, ITestInvocationListener listener)
abstract
void
onTestAssumptionFailure(DeviceMetricData testData, TestDescription test)
abstract
void
onTestEnd(DeviceMetricData testData,
abstract
void
onTestEnd(DeviceMetricData testData,
abstract
void
onTestFail(DeviceMetricData testData, TestDescription test)
default
void
onTestModuleEnded()
default
void
onTestModuleStarted()
abstract
void
onTestRunEnd(DeviceMetricData runData,
abstract
void
onTestRunStart(DeviceMetricData runData)
default
void
onTestRunStart(DeviceMetricData runData, int testCount)
abstract
void
onTestStart(DeviceMetricData testData)
Public methods
captureModuleLevel
public boolean captureModuleLevel ()
Returns
boolean
getBuildInfos
public abstract
Returns
getDevices
public abstract
Returns
getInvocationListener
public abstract ITestInvocationListener getInvocationListener ()
ITestInvocationListener
where we are forwarding the results.
Returns
ITestInvocationListener
init
public abstract ITestInvocationListener init (IInvocationContext context,
ITestInvocationListener listener)
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.
Throws
DeviceNotAvailableException
onTestAssumptionFailure
public abstract void onTestAssumptionFailure (DeviceMetricData testData,
TestDescription test)
Parameters
testData
DeviceMetricData
: the DeviceMetricData
holding the data for the test case.
test
TestDescription
: the TestDescription
of the test case in progress.
Throws
DeviceNotAvailableException
onTestEnd
public abstract void onTestEnd (DeviceMetricData testData,
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))
.
test
TestDescription
: the TestDescription
of the test case in progress.
Throws
DeviceNotAvailableException
onTestEnd
public abstract void onTestEnd (DeviceMetricData testData,
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
onTestFail
public abstract void onTestFail (DeviceMetricData testData,
TestDescription test)
Parameters
testData
DeviceMetricData
: the DeviceMetricData
holding the data for the test case.
test
TestDescription
: the TestDescription
of the test case in progress.
Throws
DeviceNotAvailableException
onTestModuleEnded
public void onTestModuleEnded ()
Throws
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException
onTestModuleStarted
public void onTestModuleStarted ()
Throws
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException
onTestRunEnd
public abstract void onTestRunEnd (DeviceMetricData runData,
Parameters
runData
DeviceMetricData
: the DeviceMetricData
holding the data for the run. Will be the same
object as during onTestRunStart(com.android.tradefed.device.metric.DeviceMetricData)
.
currentRunMetrics
: the current map of metrics passed to ERROR(/#testRunEnded(long,Map))
.
Throws
DeviceNotAvailableException
onTestRunStart
public abstract void onTestRunStart (DeviceMetricData runData)
Parameters
runData
DeviceMetricData
: the DeviceMetricData
holding the data for the run.
Throws
DeviceNotAvailableException
onTestRunStart
public void onTestRunStart (DeviceMetricData runData,
int testCount)
Parameters
runData
DeviceMetricData
: the DeviceMetricData
holding the data for the run.
testCount
int
: the number of test cases in this test run.
Throws
DeviceNotAvailableException
onTestStart
public abstract void onTestStart (DeviceMetricData testData)
Parameters
testData
DeviceMetricData
: the DeviceMetricData
holding the data for the test case.
Throws
DeviceNotAvailableException