| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 import collections | 5 import collections |
| 6 import copy | 6 import copy |
| 7 import itertools | 7 import itertools |
| 8 import threading | 8 import threading |
| 9 import time | 9 import time |
| 10 | 10 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 fields (tuple): a normalized field tuple. | 71 fields (tuple): a normalized field tuple. |
| 72 target_fields (dict or None): target fields to override. | 72 target_fields (dict or None): target fields to override. |
| 73 default: the value to return if the metric has no value of this set of | 73 default: the value to return if the metric has no value of this set of |
| 74 field values. | 74 field values. |
| 75 """ | 75 """ |
| 76 raise NotImplementedError | 76 raise NotImplementedError |
| 77 | 77 |
| 78 def get_all(self): | 78 def get_all(self): |
| 79 """Returns an iterator over all the metrics present in the store. | 79 """Returns an iterator over all the metrics present in the store. |
| 80 | 80 |
| 81 The iterator yields 4-tuples: | 81 The iterator yields 5-tuples: |
| 82 (target, metric, start_time, field_values) | 82 (target, metric, start_time, end_time, field_values) |
| 83 """ | 83 """ |
| 84 raise NotImplementedError | 84 raise NotImplementedError |
| 85 | 85 |
| 86 def set(self, name, fields, target_fields, value, enforce_ge=False): | 86 def set(self, name, fields, target_fields, value, enforce_ge=False): |
| 87 """Sets the metric's value. | 87 """Sets the metric's value. |
| 88 | 88 |
| 89 Args: | 89 Args: |
| 90 name: the metric's name. | 90 name: the metric's name. |
| 91 fields: a normalized field tuple. | 91 fields: a normalized field tuple. |
| 92 target_fields (dict or None): target fields to override. | 92 target_fields (dict or None): target fields to override. |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 | 294 |
| 295 def reset_for_unittest(self, name=None): | 295 def reset_for_unittest(self, name=None): |
| 296 if name is not None: | 296 if name is not None: |
| 297 self._reset(name) | 297 self._reset(name) |
| 298 else: | 298 else: |
| 299 for name in self._values.keys(): | 299 for name in self._values.keys(): |
| 300 self._reset(name) | 300 self._reset(name) |
| 301 | 301 |
| 302 def _reset(self, name): | 302 def _reset(self, name): |
| 303 self._values[name] = MetricValues(self, self._start_time(name)) | 303 self._values[name] = MetricValues(self, self._start_time(name)) |
| OLD | NEW |