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 ()
受保護的方法
logFormattedWarning
protected void logFormattedWarning (String message)
CLog.w() 的包裝函式,可讓測試觀察格式化的警告。
| 參數 | |
|---|---|
message |
String |
parseMetricsFromReportList
protectedparseMetricsFromReportList (StatsLog.ConfigMetricsReportList reportList)
使用原子格式設定器,剖析 ConfigMetricsReportList 中的量測儀指標。
導致重複鍵的事件指標會以半形逗號分隔的值儲存。
| 參數 | |
|---|---|
reportList |
StatsLog.ConfigMetricsReportList |
| 傳回 | |
|---|---|
|
|