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 |