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
。
之前/之後的指標通過名稱匹配增量計算,因此假定格式化程序將確保每個快照在其中生成唯一的指標集。處理器將在這些情況下生成警告:
- 每個快照中的格式化程序都會生成重複的指標鍵
- 原子或度量鍵存在於一個快照中,但不存在於另一個快照中
概括
公共構造函數 | |
---|---|
StatsdBeforeAfterGaugeMetricPostProcessor () |
受保護的方法 | |
---|---|
void | logFormattedWarning (String message) 圍繞 |
parseMetricsFromReportList (StatsLog.ConfigMetricsReportList reportList) 使用原子格式化程序從 |
公共構造函數
StatsdBeforeAfterGaugeMetricPostProcessor
public StatsdBeforeAfterGaugeMetricPostProcessor ()
受保護的方法
日誌格式化警告
protected void logFormattedWarning (String message)
圍繞CLog.w()
包裝器,使測試能夠觀察格式化的警告。
參數 | |
---|---|
message | String |
parseMetricsFromReportList
protectedparseMetricsFromReportList (StatsLog.ConfigMetricsReportList reportList)
使用原子格式化程序從ConfigMetricsReportList
解析儀表指標。
導致重複鍵的事件指標將存儲為逗號分隔值。
參數 | |
---|---|
reportList | StatsLog.ConfigMetricsReportList |
退貨 | |
---|---|