[llvm] [CI] Always upload queue/running count (PR #134814)
Nathan Gauër via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 8 02:01:40 PDT 2025
https://github.com/Keenuts updated https://github.com/llvm/llvm-project/pull/134814
>From e9ef86454fc19b138dfa1358c20d7f23c04ba922 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?= <brioche at google.com>
Date: Tue, 8 Apr 2025 10:52:57 +0200
Subject: [PATCH 1/2] [CI] Always upload queue/running count
Before this commit, we only pushed a queue/running count when the
value was not zero. This makes building Grafana alerting a bit harder.
Changing this to always upload a value for watched workflows.
---
.ci/metrics/metrics.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/.ci/metrics/metrics.py b/.ci/metrics/metrics.py
index 8069e262a68ec..55530e8d89be6 100644
--- a/.ci/metrics/metrics.py
+++ b/.ci/metrics/metrics.py
@@ -282,6 +282,13 @@ def github_get_metrics(
queued_count = collections.Counter()
running_count = collections.Counter()
+ # Initialize all the counters to 0 so we report 0 when no job is queued
+ # or running.
+ for wf_name, wf_metric_name in GITHUB_WORKFLOW_TO_TRACK.items():
+ for job_name, job_metric_name in GITHUB_JOB_TO_TRACK[wf_metric_name].items():
+ queued_count[wf_metric_name + "_" + job_metric_name] = 0
+ running_count[wf_metric_name + "_" + job_metric_name] = 0
+
# The list of workflows this iteration will process.
# MaxSize = GITHUB_WORKFLOWS_MAX_PROCESS_COUNT
workflow_seen_as_completed = set()
>From 37682881ed82d98a7742b45618b8ba3891aec5d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?= <brioche at google.com>
Date: Tue, 8 Apr 2025 11:01:23 +0200
Subject: [PATCH 2/2] clang-format
---
.ci/metrics/metrics.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.ci/metrics/metrics.py b/.ci/metrics/metrics.py
index 55530e8d89be6..a5ee893650d63 100644
--- a/.ci/metrics/metrics.py
+++ b/.ci/metrics/metrics.py
@@ -285,9 +285,9 @@ def github_get_metrics(
# Initialize all the counters to 0 so we report 0 when no job is queued
# or running.
for wf_name, wf_metric_name in GITHUB_WORKFLOW_TO_TRACK.items():
- for job_name, job_metric_name in GITHUB_JOB_TO_TRACK[wf_metric_name].items():
- queued_count[wf_metric_name + "_" + job_metric_name] = 0
- running_count[wf_metric_name + "_" + job_metric_name] = 0
+ for job_name, job_metric_name in GITHUB_JOB_TO_TRACK[wf_metric_name].items():
+ queued_count[wf_metric_name + "_" + job_metric_name] = 0
+ running_count[wf_metric_name + "_" + job_metric_name] = 0
# The list of workflows this iteration will process.
# MaxSize = GITHUB_WORKFLOWS_MAX_PROCESS_COUNT
More information about the llvm-commits
mailing list