| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 class Metric(object): | 5 class Metric(object): |
| 6 """Base class for all the metrics that are used by telemetry measurements. | 6 """Base class for all the metrics that are used by telemetry measurements. |
| 7 | 7 |
| 8 The Metric class represents a way of measuring something. Metrics are | 8 The Metric class represents a way of measuring something. Metrics are |
| 9 helper classes used by PageMeasurements. Each PageMeasurement may use | 9 helper classes used by PageMeasurements. Each PageMeasurement may use |
| 10 multiple metrics; each metric should be focussed on collecting data | 10 multiple metrics; each metric should be focussed on collecting data |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 def Stop(self, page, tab): | 30 def Stop(self, page, tab): |
| 31 """Stop collecting data for this metric (if applicable).""" | 31 """Stop collecting data for this metric (if applicable).""" |
| 32 pass | 32 pass |
| 33 | 33 |
| 34 def AddResults(self, tab, results): | 34 def AddResults(self, tab, results): |
| 35 """Add the data collected into the results object for a measurement. | 35 """Add the data collected into the results object for a measurement. |
| 36 | 36 |
| 37 Metrics may implement AddResults to provide a common way to add results | 37 Metrics may implement AddResults to provide a common way to add results |
| 38 to the PageMeasurementResults in PageMeasurement.AddMeasurement -- | 38 to the PageMeasurementResults in PageMeasurement.AddMeasurement -- |
| 39 results should be added with results.Add(trace_name, unit, value). | 39 results should be added with results.AddValue(...). |
| 40 """ | 40 """ |
| 41 raise NotImplementedError() | 41 raise NotImplementedError() |
| OLD | NEW |