StatsdBeforeAfterGaugeMetricPostProcessor
public
class
StatsdBeforeAfterGaugeMetricPostProcessor
extends StatsdGenericPostProcessor
java.lang.Object | |||
↳ | com.android.tradefed.postprocessor.BasePostProcessor | ||
↳ | com.android.tradefed.postprocessor.StatsdGenericPostProcessor | ||
↳ | com.android.tradefed.postprocessor.StatsdBeforeAfterGaugeMetricPostProcessor |
后处理器,用于处理以“前/后”方式收集的衡量指标,即在测试/运行前和测试/运行后各有一个快照,根据提供的指标格式设置列表提取指标并报告其增量。
以这种方式收集的指标如下所示:(指标位于原子中)
reports { metrics { gauge_metrics { data { # Bucket for the "before" snapshot bucket_info { atom {...} atom {...} ... } # Bucket for the "after" snapshot bucket_info { atom {...} atom {...} ... } } } ... } ... }
例如,如果提供的指标格式设置为键为 on_device_power_measurement
,值为 [subsystem_name]-[rail_name]=[energy_microwatt_secs]
,则当 subsystem_name
为 display
、rail_name
为 RAIL_NAME
且 energy_microwatt_secs
为 10
时,原子的指标将如下所示:statsd-<config
name>-gauge-on_device_power_measurement-delta-display-RAIL_NAME=10
。
系统会按名称匹配“前”/“后”指标以计算增量,因此假定格式设置将确保每个快照在其中生成唯一的指标集。在以下情况下,处理器会生成警告:
- 每个快照中都有格式设置程序生成的重复指标键
- 某个数据快照中包含某个 Atom 或指标键,而另一个数据快照中不包含该键
摘要
公共构造函数 | |
---|---|
StatsdBeforeAfterGaugeMetricPostProcessor()
|
受保护的方法 | |
---|---|
void
|
logFormattedWarning(String message)
封装了 |
|
parseMetricsFromReportList(StatsLog.ConfigMetricsReportList reportList)
使用原子格式设置程序解析 |
公共构造函数
StatsdBeforeAfterGaugeMetricPostProcessor
public StatsdBeforeAfterGaugeMetricPostProcessor ()
受保护的方法
logFormattedWarning
protected void logFormattedWarning (String message)
封装了 CLog.w()
的封装容器,可让测试观察格式化的警告。
参数 | |
---|---|
message |
String |
parseMetricsFromReportList
protectedparseMetricsFromReportList (StatsLog.ConfigMetricsReportList reportList)
使用原子格式设置程序解析 ConfigMetricsReportList
中的指针仪表指标。
导致键重复的事件指标将以逗号分隔的值存储。
参数 | |
---|---|
reportList |
StatsLog.ConfigMetricsReportList |
返回 | |
---|---|
|