From 0ae1f4378a10c3a7cc424a9a56f4ead2cdeb65dd Mon Sep 17 00:00:00 2001 From: Vitor Guidi Date: Mon, 9 Dec 2024 05:28:50 +0000 Subject: [PATCH] Emiting metric in place, fixing lint --- .../_internal/bot/tasks/utasks/__init__.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/clusterfuzz/_internal/bot/tasks/utasks/__init__.py b/src/clusterfuzz/_internal/bot/tasks/utasks/__init__.py index 4a4b92ca96..4288a70a0a 100644 --- a/src/clusterfuzz/_internal/bot/tasks/utasks/__init__.py +++ b/src/clusterfuzz/_internal/bot/tasks/utasks/__init__.py @@ -33,14 +33,6 @@ Timestamp = timestamp_pb2.Timestamp # pylint: disable=no-member -def _emit_task_outcome_metric(task, job, outcome): - monitoring_metrics.TASK_OUTCOME_COUNT.increment(labels={ - 'job': job, - 'task': task, - 'outcome': outcome, - }) - - class Mode(enum.Enum): """The execution mode of `uworker_main` tasks in a bot process.""" @@ -147,7 +139,9 @@ def __exit__(self, _exc_type, _exc_value, _traceback): e2e_duration_secs, self._labels) outcome = 'error' if _exc_type else 'success' - monitoring_metrics.TASK_OUTCOME_COUNT.increment({**self._labels, 'outcome': outcome}) + monitoring_metrics.TASK_OUTCOME_COUNT.increment({ + **self._labels, 'outcome': outcome + }) def ensure_uworker_env_type_safety(uworker_env):