FilePullerDeviceMetricCollector

public abstract class FilePullerDeviceMetricCollector
extends BaseDeviceMetricCollector

java.lang.Object
com.android.tradefed.device.metric.BaseDeviceMetricCollector
  com.android.tradefed.device.metric.FilePullerDeviceMetricCollector


A BaseDeviceMetricCollector that listen for metrics key coming from the device and pull them as a file from the device. Can be extended for extra-processing of the file.

สรุป

ฟิลด์

protected Set<String> mDirectoryKeys

public Map<String, String> mTestCaseMetrics

เครื่องมือสร้างสาธารณะ

FilePullerDeviceMetricCollector()

เมธอดสาธารณะ

void onTestEnd(DeviceMetricData testData, Map<String, MetricMeasurement.Metric> currentTestCaseMetrics)

Callback when a test case is ended.

void onTestRunEnd(DeviceMetricData runData, Map<String, MetricMeasurement.Metric> currentRunMetrics)

Callback when a test run is ended.

abstract void processMetricDirectory(String key, File metricDirectory, DeviceMetricData data)

Implementation of the method should allow to log the directory, parse it for metrics to be put in DeviceMetricData.

abstract void processMetricFile(String key, File metricFile, DeviceMetricData data)

Implementation of the method should allow to log the file, parse it for metrics to be put in DeviceMetricData.

เมธอดที่ได้รับการปกป้อง

void addKeys(String... keys)

Adds additional pattern keys to the pull from the device.

File retrieveFile(ITestDevice device, String remoteFilePath, int userId)

Pull the file from the specified path in the device.

ฟิลด์

mDirectoryKeys

protected Set<String> mDirectoryKeys

mTestCaseMetrics

public Map<String, String> mTestCaseMetrics

เครื่องมือสร้างสาธารณะ

FilePullerDeviceMetricCollector

public FilePullerDeviceMetricCollector ()

เมธอดสาธารณะ

onTestEnd

public void onTestEnd (DeviceMetricData testData, 
                Map<String, MetricMeasurement.Metric> currentTestCaseMetrics)

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

พารามิเตอร์
testData DeviceMetricData: the DeviceMetricData holding the data for the test case. Will be the same object as during onTestStart(DeviceMetricData).

currentTestCaseMetrics Map: the current map of metrics passed to testEnded(TestDescription,Map).

ส่ง
DeviceNotAvailableException

onTestRunEnd

public void onTestRunEnd (DeviceMetricData runData, 
                Map<String, MetricMeasurement.Metric> currentRunMetrics)

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

พารามิเตอร์
runData DeviceMetricData: the DeviceMetricData holding the data for the run. Will be the same object as during onTestRunStart(DeviceMetricData).

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

ส่ง
DeviceNotAvailableException

processMetricDirectory

public abstract void processMetricDirectory (String key, 
                File metricDirectory, 
                DeviceMetricData data)

Implementation of the method should allow to log the directory, parse it for metrics to be put in DeviceMetricData.

พารามิเตอร์
key String: the option key associated to the directory that was pulled.

metricDirectory File: the File pulled from the device matching the option key.

data DeviceMetricData: the DeviceMetricData where metrics can be stored.

processMetricFile

public abstract void processMetricFile (String key, 
                File metricFile, 
                DeviceMetricData data)

Implementation of the method should allow to log the file, parse it for metrics to be put in DeviceMetricData.

พารามิเตอร์
key String: the option key associated to the file that was pulled.

metricFile File: the File pulled from the device matching the option key.

data DeviceMetricData: the DeviceMetricData where metrics can be stored.

เมธอดที่ได้รับการปกป้อง

addKeys

protected void addKeys (String... keys)

Adds additional pattern keys to the pull from the device.

พารามิเตอร์
keys String

retrieveFile

protected File retrieveFile (ITestDevice device, 
                String remoteFilePath, 
                int userId)

Pull the file from the specified path in the device.

พารามิเตอร์
device ITestDevice: which has the file.

remoteFilePath String: location in the device.

userId int: the user id to pull from

การคืนสินค้า
File File retrieved from the given path in the device.

ส่ง
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException