统计通用后处理器
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) 解析从 statsd 报告原型读取的 |
公共构造函数
统计通用后处理器
public StatsdGenericPostProcessor ()
公共方法
进程运行指标和日志
publicprocessRunMetricsAndLogs ( rawMetrics, runLogs)
实现此方法是为了从现有指标和日志生成一组新指标。仅应返回新生成的指标,并具有唯一的键名称(不允许与现有键发生冲突)。
参数 | |
---|---|
rawMetrics | |
runLogs |
退货 | |
---|---|
从运行指标新生成的一组指标。 |
流程测试指标和日志
publicprocessTestMetricsAndLogs (TestDescription testDescription, testMetrics, testLogs)
实现此方法以发布每个测试的流程指标和日志。仅应返回新生成的指标,并具有唯一的键名称(不允许与现有键发生冲突)。
参数 | |
---|---|
testDescription | TestDescription :描述测试的 TestDescription 对象。 |
testMetrics | |
testLogs |
退货 | |
---|---|
从测试指标新生成的一组指标。 |
受保护的方法
转换ProtoMessage
protectedconvertProtoMessage (Message reportMessage)
将原始消息扁平化为一组成为指标的键值对。
它将消息视为一棵树,并使用从根到非消息值的串联路径作为键,而非消息值则成为度量值。来自重复字段的节点通过将一个基于 1 的索引号附加到第一个元素之后的所有元素来区分。第一个元素不会被附加,因为在大多数情况下,列表字段中只有一个元素,并且按原样显示更容易阅读。
TODO(b/140432161):如果需要,将其分离到实用程序中。
参数 | |
---|---|
reportMessage | Message |
退货 | |
---|---|
获取指标类型
protected MetricMeasurement.DataType getMetricType ()
将指标类型设置为 RAW 指标。
退货 | |
---|---|
MetricMeasurement.DataType |
从报告列表中解析指标
protectedparseMetricsFromReportList (StatsLog.ConfigMetricsReportList reportList)
解析从 statsd 报告原型读取的ConfigMetricsReportList
中的指标。
这是该 statsd 后处理器子类的主接口。
参数 | |
---|---|
reportList | StatsLog.ConfigMetricsReportList |
退货 | |
---|---|