IResourceMetricCollector

public interface IResourceMetricCollector

com.android.tradefed.monitoring.collector.IResourceMetricCollector


使用者實作自訂資源收集器的介面。

摘要

公用方法

default long getDeviceMetricizeTimeoutMs()

以毫秒為單位取得裝置指標化逾時時間。

default getDeviceResourceMetrics(DeviceDescriptor descriptor, IDeviceManager deviceManager)

收集裝置資源指標。

default long getHostMetricizeTimeoutMs()

以毫秒為單位,取得主機的評估逾時時間。

default getHostResourceMetrics()

收集主機資源指標。

公用方法

getDeviceMetricizeTimeoutMs

public long getDeviceMetricizeTimeoutMs ()

以毫秒為單位取得裝置評估逾時時間。

傳回
long

getDeviceResourceMetrics

public  getDeviceResourceMetrics (DeviceDescriptor descriptor, 
                IDeviceManager deviceManager)

收集裝置資源指標。函式必須在 getDeviceMetricizeTimeoutMs() 毫秒內傳回,否則結果會遭到 LabResourceDeviceMonitor 捨棄。此外,請在耗用大量資源的作業前檢查 Thread.currentThread().isInterrupted(),並立即傳回。

參數
descriptor DeviceDescriptor:關於評估裝置的 DeviceDescriptor

deviceManager IDeviceManagerIDeviceManager 例項。

傳回
裝置 ResourceERROR(/Collection)

getHostMetricizeTimeoutMs

public long getHostMetricizeTimeoutMs ()

以毫秒為單位,取得主機評估逾時時間。

傳回
long

getHostResourceMetrics

public  getHostResourceMetrics ()

收集主機資源指標。函式必須在 getHostMetricizeTimeoutMs() 毫秒內傳回,否則結果會遭到 LabResourceDeviceMonitor 捨棄。此外,請在耗用大量資源的作業前檢查 Thread.currentThread().isInterrupted(),並立即傳回。

傳回
主機 ResourceERROR(/Collection)