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 Collection<Resource> getDeviceResourceMetrics(DeviceDescriptor descriptor, IDeviceManager deviceManager)

Collects device resource metrics.

default long getHostMetricizeTimeoutMs()

Gets the host metricize timeout in ms.

default Collection<Resource> getHostResourceMetrics()

Collects host resource metrics.

Public methods

getDeviceMetricizeTimeoutMs

public long getDeviceMetricizeTimeoutMs ()

Gets the device metricize timeout in ms.

Returns
long

getDeviceResourceMetrics

public Collection<Resource> getDeviceResourceMetrics (DeviceDescriptor descriptor, 
                IDeviceManager deviceManager)

Collects device resource metrics. The function must return in IResourceMetricCollector.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
Collection<Resource> a Collection of device Resource.

getHostMetricizeTimeoutMs

public long getHostMetricizeTimeoutMs ()

Gets the host metricize timeout in ms.

Returns
long

getHostResourceMetrics

public Collection<Resource> getHostResourceMetrics ()

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

Returns
Collection<Resource> a Collection of host Resource.