HostStatsdMetricCollector

public class HostStatsdMetricCollector
extends BaseDeviceMetricCollector

java.lang.Object
   ↳ com.android.tradefed.device.metric.BaseDeviceMetricCollector
     ↳ com.android.tradefed.device.metric.HostStatsdMetricCollector


A IMetricCollector that collects statsd metrics from host side using statsd utility commands. It has basic push metrics and dump report functions. It can be extended by subclasses to process statsd metric report based on the needs.

Summary

Public constructors

HostStatsdMetricCollector()

Public methods

void onTestRunEnd(DeviceMetricData runData, currentRunMetrics)

Callback when a test run is ended.

void onTestRunStart(DeviceMetricData runData)

Callback when a test run is started.

Protected methods

void processStatsReport(ITestDevice device, InputStreamSource dataStream, DeviceMetricData runData)

Subclasses can implement the method to process Statsd metric report if needed.

Public constructors

HostStatsdMetricCollector

public HostStatsdMetricCollector ()

Public methods

onTestRunEnd

public void onTestRunEnd (DeviceMetricData runData, 
                 currentRunMetrics)

Callback when a test run is ended. This should be the time for clean up.

Parameters
runData DeviceMetricData: the DeviceMetricData holding the data for the run. Will be the same object as during onTestRunStart(com.android.tradefed.device.metric.DeviceMetricData).

currentRunMetrics : the current map of metrics passed to ERROR(/#testRunEnded(long,Map)).

onTestRunStart

public void onTestRunStart (DeviceMetricData runData)

Callback when a test run is started.

Parameters
runData DeviceMetricData: the DeviceMetricData holding the data for the run.

Protected methods

processStatsReport

protected void processStatsReport (ITestDevice device, 
                InputStreamSource dataStream, 
                DeviceMetricData runData)

Subclasses can implement the method to process Statsd metric report if needed. It is called for metric report from a particular device

Parameters
device ITestDevice: Test device where the statsd report is coming from

dataStream InputStreamSource: Stats report as input stream

runData DeviceMetricData: The destination where the processed metrics will be stored