mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
metrics: Add function to collect repeated metrics.
Bug: 897394 Change-Id: Iece4507c7bf92d7a8aad045d31b4f06e54b3af15 Reviewed-on: https://chromium-review.googlesource.com/c/1292243 Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This commit is contained in:
@@ -161,6 +161,11 @@ class MetricsCollector(object):
|
||||
with self._metrics_lock:
|
||||
self._reported_metrics[name] = value
|
||||
|
||||
def add_repeated(self, name, value):
|
||||
if self._collect_custom_metrics:
|
||||
with self._metrics_lock:
|
||||
self._reported_metrics.setdefault(name, []).append(value)
|
||||
|
||||
@contextlib.contextmanager
|
||||
def pause_metrics_collection(self):
|
||||
collect_custom_metrics = self._collect_custom_metrics
|
||||
|
||||
Reference in New Issue
Block a user