IMetricCollector接收器
public interface IMetricCollectorReceiver
com.android.tradefed.device.metric.IMetricCollectorReceiver |
如果IRemoteTest
需要获取用于测试运行的IMetricCollector
列表,则需要实现 IRemoteTest 的接口。
实现此接口的测试将不会使用收集器来检测其默认的ITestInvocationListener
,它们必须通过IMetricCollector.init(com.android.tradefed.invoker.IInvocationContext, com.android.tradefed.result.ITestInvocationListener)
自行完成。
一些测试机制涉及缓冲 Tradefed 回调并在最后重放(如ITestSuite
中),这种机制会导致收集器在重放期间被调用,而不是在实际执行期间被调用。通过让测试运行程序处理何时使用收集器,我们可以确保在适当的时间处理回调。
In order to use the collectors, the following pattern can be used: for (IMetricCollector collector : config.getMetricCollectors()) { originalCollector = collector.init(mModuleInvocationContext, originalCollector); }将包含所有度量收集器以按顺序调用。
概括
公共方法 | |
---|---|
abstract void | setMetricCollectors ( collectors) setMetricCollectors ( collectors) 设置为测试运行定义的 |
公共方法
设置MetricCollectors
public abstract void setMetricCollectors (collectors)
设置为测试运行定义的IMetricCollector
列表。
参数 | |
---|---|
collectors |