(self, name=None)
| 1863 | self._name = name |
| 1864 | |
| 1865 | def _get_existing_metric(self, name=None): |
| 1866 | match = [m for m in self._metrics if m.name == name] |
| 1867 | if not match: |
| 1868 | return |
| 1869 | if len(match) > 1: |
| 1870 | raise ValueError( |
| 1871 | 'Please provide different names for the metrics you have added. ' |
| 1872 | 'We found {} metrics with the name: "{}"'.format(len(match), name)) |
| 1873 | return match[0] |
| 1874 | |
| 1875 | def _eager_add_metric(self, value, aggregation=None, name=None): |
| 1876 | # If the given metric is available in `metrics` list we just update state |
no test coverage detected