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_namedisplayrail_nameRAIL_NAMEenergy_microwatt_secs10的原子的度量将类似于statsd-<config name>-gauge-on_device_power_measurement-delta-display-RAIL_NAME=10

之前/之后的指标通过其名称来匹配增量计算,因此假设格式化程序将确保每个快照在其中生成唯一的指标集。处理器将在以下情况下生成警告:

  • 每个快照中的格式化程序都会生成重复的指标键
  • 原子或度量键存在于一个快照中,但不存在于另一个快照中

概括

公共构造函数

StatsdBeforeAfterGaugeMetricPostProcessor ()

受保护的方法

void logFormattedWarning (String message)

CLog.w()的包装器,使测试能够观察格式化的警告。

parseMetricsFromReportList (StatsLog.ConfigMetricsReportList reportList)

使用原子格式化程序从ConfigMetricsReportList解析仪表指标。

公共构造函数

StatsdBeforeAfterGaugeMetricPostProcessor

public StatsdBeforeAfterGaugeMetricPostProcessor ()

受保护的方法

日志格式化警告

protected void logFormattedWarning (String message)

CLog.w()的包装器,使测试能够观察格式化的警告。

参数
message String

从报告列表中解析指标

protected  parseMetricsFromReportList (StatsLog.ConfigMetricsReportList reportList)

使用原子格式化程序从ConfigMetricsReportList解析仪表指标。

导致重复键的事件指标将存储为逗号分隔值。

参数
reportList StatsLog.ConfigMetricsReportList

退货