Skip to content

Commit

Permalink
Emiting metric in place, fixing lint
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorguidi committed Dec 9, 2024
1 parent 49844d6 commit 0ae1f43
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/clusterfuzz/_internal/bot/tasks/utasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 0ae1f43

Please sign in to comment.