IResourceMetricCollector

public interface IResourceMetricCollector

com.android.tradefed.monitoring.collector.IResourceMetricCollector


The interface for user to implement customized resource collectors.

Summary

Public methods

default long getDeviceMetricizeTimeoutMs()

Gets the device metricize timeout in ms.

default getDeviceResourceMetrics(DeviceDescriptor descriptor, IDeviceManager deviceManager)

Collects device resource metrics.

default long getHostMetricizeTimeoutMs()

Gets the host metricize timeout in ms.

default getHostResourceMetrics()

Collects host resource metrics.

Public methods

getDeviceMetricizeTimeoutMs

public long getDeviceMetricizeTimeoutMs ()

Gets the device metricize timeout in ms.

Returns
long

getDeviceResourceMetrics

public  getDeviceResourceMetrics (DeviceDescriptor descriptor, 
                IDeviceManager deviceManager)

Collects device resource metrics. The function must return in getDeviceMetricizeTimeoutMs() ms, otherwise the result will be dropped by the LabResourceDeviceMonitor. Also, please check Thread.currentThread().isInterrupted() before expensive operation and return immediately.

Parameters
descriptor DeviceDescriptor: the DeviceDescriptor about the metricizing device.

deviceManager IDeviceManager: the IDeviceManager instance.

Returns
a ERROR(/Collection) of device Resource.

getHostMetricizeTimeoutMs

public long getHostMetricizeTimeoutMs ()

Gets the host metricize timeout in ms.

Returns
long

getHostResourceMetrics

public  getHostResourceMetrics ()

Collects host resource metrics. The function must return in getHostMetricizeTimeoutMs() ms, otherwise the result will be dropped by the LabResourceDeviceMonitor. Also, please check Thread.currentThread().isInterrupted() before expensive operation and return immediately.

Returns
a ERROR(/Collection) of host Resource.