PerfettoGenericPostProcessor

public class PerfettoGenericPostProcessor
extends BasePostProcessor

java.lang.Object
   ↳ com.android.tradefed.postprocessor.BasePostProcessor
     ↳ com.android.tradefed.postprocessor.PerfettoGenericPostProcessor


A post processor that processes text/binary metric perfetto proto file into key-value pairs by recursively expanding the proto messages and fields with string values until the field with numeric value is encountered. Treats enum and boolean as string values while constructing the keys.

It optionally supports indexing list fields when there are duplicates while constructing the keys. For example

"perfetto-indexed-list-field" - perfetto.protos.AndroidStartupMetric.Startup

"perfetto-prefix-key-field" - perfetto.protos.ProcessRenderInfo.process_name

android_startup-startup#1-package_name-com.calculator-to_first_frame-dur_ns: 300620342 android_startup-startup#2-package_name-com.nexuslauncher-to_first_frame-dur_ns: 49257713 android_startup-startup#3-package_name-com.calculator-to_first_frame-dur_ns: 261382005

Summary

Public constructors

PerfettoGenericPostProcessor()

Public methods

processRunMetricsAndLogs( rawMetrics, runLogs)

Implement this method in order to generate a set of new metrics from the existing metrics and logs.

processTestMetricsAndLogs(TestDescription testDescription, testMetrics, testLogs)

Implement this method to post process metrics and logs from each test.

Protected methods

MetricMeasurement.DataType getMetricType()

Set the metric type to RAW metric.

Public constructors

PerfettoGenericPostProcessor

public PerfettoGenericPostProcessor ()

Public methods

processRunMetricsAndLogs

public  processRunMetricsAndLogs ( rawMetrics, 
                 runLogs)

Implement this method in order to generate a set of new metrics from the existing metrics and logs. Only the newly generated metrics should be returned, and with unique key name (no collision with existing keys are allowed).

Parameters
rawMetrics : The set of raw metrics available for the run.

runLogs : The set of log files for the test run.

Returns
The set of newly generated metrics from the run metrics.

processTestMetricsAndLogs

public  processTestMetricsAndLogs (TestDescription testDescription, 
                 testMetrics, 
                 testLogs)

Implement this method to post process metrics and logs from each test. Only the newly generated metrics should be returned, and with unique key name (no collision with existing keys are allowed).

Parameters
testDescription TestDescription: The TestDescription object describing the test.

testMetrics : The set of metrics from the test.

testLogs : The set of files logged during the test.

Returns
The set of newly generated metrics from the test metrics.

Protected methods

getMetricType

protected MetricMeasurement.DataType getMetricType ()

Set the metric type to RAW metric.

Returns
MetricMeasurement.DataType