Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
Stay organized with collections
Save and categorize content based on your preferences.
IMetricCollector
public
interface
IMetricCollector
implements
ILogSaverListener,
IDisableable
com.android.tradefed.device.metric.IMetricCollector
|
Known indirect subclasses
BaseDeviceMetricCollector, BugreportzOnFailureCollector, ClangCodeCoverageCollector, CountTestCasesCollector, DebugHostLogOnFailureCollector, FilePullerDeviceMetricCollector, FilePullerLogCollector, GcovCodeCoverageCollector, JavaCodeCoverageCollector, LogcatOnFailureCollector, ScreenshotOnFailureCollector
|
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 even it extends ITestInvocationListener
. The configuration checking will reject it. It must be used as a
"metrics_collector".
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 init(com.android.tradefed.invoker.IInvocationContext, com.android.tradefed.result.ITestInvocationListener)
.
Summary
Public methods
getBuildInfos
public abstract getBuildInfos ()
Returns the list of build information available in the invocation.
getDevices
public abstract getDevices ()
Returns the list of devices available in the invocation.
getInvocationListener
public abstract ITestInvocationListener getInvocationListener ()
Returns the original ITestInvocationListener
where we are forwarding the results.
Returns |
ITestInvocationListener |
|
init
public abstract 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.
Returns |
ITestInvocationListener |
the new listener wrapping the original one.
|
onTestAssumptionFailure
public abstract void onTestAssumptionFailure (DeviceMetricData testData,
TestDescription test)
Callback when a test case fails with assumption failure.
Parameters |
testData |
DeviceMetricData : the DeviceMetricData holding the data for the test case. |
test |
TestDescription : the TestDescription of the test case in progress.
|
onTestEnd
public abstract void onTestEnd (DeviceMetricData testData,
currentTestCaseMetrics)
Callback when a test case is ended. This should be the time for clean up.
onTestEnd
public abstract void onTestEnd (DeviceMetricData testData,
currentTestCaseMetrics,
TestDescription test)
Callback when a test case is ended. This should be the time for clean up.
onTestFail
public abstract void onTestFail (DeviceMetricData testData,
TestDescription test)
Callback when a test case fails.
Parameters |
testData |
DeviceMetricData : the DeviceMetricData holding the data for the test case. |
test |
TestDescription : the TestDescription of the test case in progress.
|
onTestRunEnd
public abstract void onTestRunEnd (DeviceMetricData runData,
currentRunMetrics)
Callback when a test run is ended. This should be the time for clean up.
onTestRunStart
public abstract void onTestRunStart (DeviceMetricData runData)
Callback when a test run is started.
Parameters |
runData |
DeviceMetricData : the DeviceMetricData holding the data for the run.
|
onTestStart
public abstract void onTestStart (DeviceMetricData testData)
Callback when a test case is started.
Parameters |
testData |
DeviceMetricData : the DeviceMetricData holding the data for the test case.
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2022-08-03 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2022-08-03 UTC."],[],[]]