Statsd通用后处理器

public class StatsdGenericPostProcessor
extends BasePostProcessor

java.lang.Object
com.android.tradefed.postprocessor.BasePostProcessor
com.android.tradefed.postprocessor.StatsdGenericPostProcessor


通过将报告扩展为树结构,将二进制原型 statsd 报告处理为键值对的后处理器。

该处理器不知道它遇到的度量报告的类型。它还通过包含检索和读取 statsd 报告的通用代码,作为其他 statsd 后处理器的基类。

概括

公共构造函数

StatsdGenericPostProcessor ()

公共方法

processRunMetricsAndLogs ( rawMetrics, runLogs) processRunMetricsAndLogs ( rawMetrics, runLogs) processRunMetricsAndLogs ( rawMetrics, runLogs)

实施此方法以便从现有指标和日志生成一组新指标。

processTestMetricsAndLogs ( TestDescription testDescription, testMetrics, testLogs) processTestMetricsAndLogs ( TestDescription testDescription, testMetrics, testLogs) processTestMetricsAndLogs ( TestDescription testDescription, testMetrics, testLogs)

实施此方法以发布每个测试的流程指标和日志。

受保护的方法

convertProtoMessage (Message reportMessage)

将原始消息扁平化为一组成为指标的键值对。

MetricMeasurement.DataType getMetricType ()

将指标类型设置为 RAW 指标。

parseMetricsFromReportList (StatsLog.ConfigMetricsReportList reportList)

ConfigMetricsReportList中解析指标,从 statsd 报告原型中读取。

公共构造函数

Statsd通用后处理器

public StatsdGenericPostProcessor ()

公共方法

processRunMetricsAndLogs

public  processRunMetricsAndLogs ( rawMetrics, 
                 runLogs)

实施此方法以便从现有指标和日志生成一组新指标。只应返回新生成的指标,并具有唯一的键名(不允许与现有键冲突)。

参数
rawMetrics :可用于运行的原始指标集。

runLogs :测试运行的日志文件集。

退货
从运行指标中新生成的一组指标。

processTestMetricsAndLogs

public  processTestMetricsAndLogs (TestDescription testDescription, 
                 testMetrics, 
                 testLogs)

实施此方法以发布每个测试的流程指标和日志。只应返回新生成的指标,并具有唯一的键名(不允许与现有键冲突)。

参数
testDescription TestDescription :描述测试的 TestDescription 对象。

testMetrics :来自测试的一组指标。

testLogs :测试期间记录的文件集。

退货
来自测试指标的一组新生成的指标。

受保护的方法

convertProtoMessage 消息

protected  convertProtoMessage (Message reportMessage)

将原始消息扁平化为一组成为指标的键值对。

它将消息视为一棵树,并使用从根到非消息值的串联路径作为键,而非消息值成为度量值。来自重复字段的节点通过在第一个元素之后附加到所有元素的基于 1 的索引号来区分。第一个元素没有附加,因为在大多数情况下只有一个元素在列表字段中并且按原样显示更容易阅读。

TODO(b/140432161):如果需要,将其分离到一个实用程序中。

参数
reportMessage Message

退货

获取指标类型

protected MetricMeasurement.DataType getMetricType ()

将指标类型设置为 RAW 指标。

退货
MetricMeasurement.DataType

parseMetricsFromReportList

protected  parseMetricsFromReportList (StatsLog.ConfigMetricsReportList reportList)

ConfigMetricsReportList中解析指标,从 statsd 报告原型中读取。

这是此 statsd 后处理器的子类的主要接口。

参数
reportList StatsLog.ConfigMetricsReportList

退货