IMetricCollectorReceiver
public interface IMetricCollectorReceiver
com.android.tradefed.device.metric.IMetricCollectorReceiver |
如果IRemoteTest
需要获取用于测试运行的IMetricCollector
列表,则要实现的接口。
实现此接口的测试将不会使用收集器检测其默认的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); }originalCollector 将环绕它的所有指标收集器按顺序调用。
概括
公共方法 | |
---|---|
abstract void | setMetricCollectors ( collectors) setMetricCollectors ( collectors) 设置为测试运行定义的 |
公共方法
setMetricCollectors
public abstract void setMetricCollectors (collectors)
设置为测试运行定义的IMetricCollector
的列表。
参数 | |
---|---|
collectors |