Chromium Code Reviews| Index: tools/perf/metrics/timeline_based_metric.py |
| diff --git a/tools/perf/metrics/timeline_based_metric.py b/tools/perf/metrics/timeline_based_metric.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..516602b2928cb1d8474d9cf25be91ec7ff10c994 |
| --- /dev/null |
| +++ b/tools/perf/metrics/timeline_based_metric.py |
| @@ -0,0 +1,21 @@ |
| +# Copyright 2014 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +class TimelineBasedMetric(object): |
| + def __init__(self): |
| + """Computes metrics from a telemetry.core.timeline Model and a range |
| + |
| + """ |
| + super(TimelineBasedMetric, self).__init__() |
| + |
| + def AddResults(self, model, renderer_thread, |
| + interaction_record, results): |
| + """ Override to actually add metrics to the results. Metric that overrides |
| + this method should only compute metric on the data between time_bound. |
|
nednguyen
2014/03/04 15:38:47
Compute metric on the data during interaction_reco
|
| + |
| + model is a model of timeline APIT. (TODO: make a shared timeline superclass) |
| + interaction_record is an instance of TimelineInteractionRecord. |
| + results is an instance of page.PageTestResults. |
|
nednguyen
2014/03/04 15:38:47
Our plan is using a results wrapper here to make s
|
| + """ |
| + raise NotImplementedError() |