后置处理器
public interface IPostProcessor
implements ITestInvocationListener , ILogSaverListener , IDisableable
com.android.tradefed.postprocessor.IPostProcessor |
后处理器是一个 Trade Federation 对象,旨在允许在测试之后和结果报告之前处理指标和日志。这允许对一些数据进行后处理并让所有 result_reporter 对象接收它,而不是仅在一个 result_reporter 内进行后处理并在传递新数据时遇到问题。
概括
公共方法 | |
---|---|
abstract ITestInvocationListener | init ( ITestInvocationListener listener) 后处理器的初始化步骤。 |
abstract | processAllTestMetricsAndLogs (ListMultimap<String, MetricMeasurement.Metric> allTestMetrics, allTestLogs) processAllTestMetricsAndLogs (ListMultimap<String, MetricMeasurement.Metric> allTestMetrics, allTestLogs) 实现此方法来聚合所有测试的指标和日志。 |
abstract | processRunMetricsAndLogs ( rawMetrics, runLogs) processRunMetricsAndLogs ( rawMetrics, runLogs) processRunMetricsAndLogs ( rawMetrics, runLogs) 实现此方法是为了从现有指标和日志生成一组新指标。 |
abstract | processTestMetricsAndLogs ( TestDescription testDescription, testMetrics, testLogs) processTestMetricsAndLogs ( TestDescription testDescription, testMetrics, testLogs) processTestMetricsAndLogs ( TestDescription testDescription, testMetrics, testLogs) 实现此方法以发布每个测试的流程指标和日志。 |
公共方法
在里面
public abstract ITestInvocationListener init (ITestInvocationListener listener)
后处理器的初始化步骤。确保在任何测试回调之前调用。
参数 | |
---|---|
listener | ITestInvocationListener |
退货 | |
---|---|
ITestInvocationListener |
处理所有测试指标和日志
public abstractprocessAllTestMetricsAndLogs (ListMultimap<String, MetricMeasurement.Metric> allTestMetrics, allTestLogs)
实现此方法来聚合所有测试的指标和日志。此方法得出的指标将作为运行指标报告。仅应返回新生成的指标,并具有唯一的键名称(不允许与现有键发生冲突)。
参数 | |
---|---|
allTestMetrics | ListMultimap :一个 HashMultimap,存储按指标名称分组的每个测试的指标。 |
allTestLogs | TestDescription 作为键。 |
退货 | |
---|---|
从所有测试指标中新生成的一组指标。 |
进程运行指标和日志
public abstractprocessRunMetricsAndLogs ( rawMetrics, runLogs)
实现此方法是为了从现有指标和日志生成一组新指标。仅应返回新生成的指标,并具有唯一的键名称(不允许与现有键发生冲突)。
参数 | |
---|---|
rawMetrics | |
runLogs |
退货 | |
---|---|
从运行指标新生成的一组指标。 |
流程测试指标和日志
public abstractprocessTestMetricsAndLogs (TestDescription testDescription, testMetrics, testLogs)
实现此方法以发布每个测试的流程指标和日志。仅应返回新生成的指标,并具有唯一的键名称(不允许与现有键发生冲突)。
参数 | |
---|---|
testDescription | TestDescription :描述测试的 TestDescription 对象。 |
testMetrics | |
testLogs |
退货 | |
---|---|
从测试指标新生成的一组指标。 |