[libcxx-commits] [libcxx] [llvm] [llvmn][CI] Update libc++ metrics to count running & queued aggregates. (PR #155298)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Aug 25 14:21:39 PDT 2025
https://github.com/cmtice updated https://github.com/llvm/llvm-project/pull/155298
>From 304d01a657e3bb5ac615aebd3b781ece2ada2f26 Mon Sep 17 00:00:00 2001
From: Caroline Tice <cmtice at google.com>
Date: Mon, 25 Aug 2025 14:16:38 -0700
Subject: [PATCH 1/2] [llvmn][CI] Update libc++ metrics to count running &
queued aggregates.
---
.ci/metrics/metrics.py | 38 ++++++++++++++++++++++++++++++++++----
1 file changed, 34 insertions(+), 4 deletions(-)
diff --git a/.ci/metrics/metrics.py b/.ci/metrics/metrics.py
index 0896b193b6b03..b77d79d012271 100644
--- a/.ci/metrics/metrics.py
+++ b/.ci/metrics/metrics.py
@@ -336,11 +336,28 @@ def github_get_metrics(
name_suffix = GITHUB_JOB_TO_TRACK[name_prefix][job.name]
metric_name = name_prefix + "_" + name_suffix
+ ag_metric_name = None
+ if libcxx_testing:
+ job_key = None
+ if job.name.find("stage1") != -1:
+ job_key = "stage1"
+ elif job.name.find("stage2") != -1:
+ job_key = "stage2"
+ elif job.name.find("stage3") != -1:
+ job_key = "stage3"
+ if job_key:
+ ag_name = name_prefix + "_" + GITHUB_JOB_TO_TRACK[name_prefix][job_key]
+
+
if task.status != "completed":
if job.status == "queued":
queued_count[metric_name] += 1
+ if libcxx_testing:
+ queued_count[ag_name] += 1
elif job.status == "in_progress":
running_count[metric_name] += 1
+ if libcxx_testing:
+ running_count[ag_name] += 1
continue
job_result = int(job.conclusion == "success" or job.conclusion == "skipped")
@@ -485,11 +502,23 @@ def upload_metrics(workflow_metrics, metrics_userid, api_key):
logging.info(f"Failed to submit data to Grafana: {response.status_code}")
+def dump_local(gh_metrics):
+ full_datetime = datetime.datetime.now()
+ dt_str = full_datetime.strftime("%Y-%m-%d_%H:%M:%S")
+ dir_name = "/usr/local/google/home/cmtice/libcxx-metrics-work"
+ filename = "gh_metrics." + dt_str + ".log"
+ full_filename = os.path.join(dir_name, filename)
+
+ with open(full_filename, 'w') as fp:
+ for entry in gh_metrics:
+ fp.write(" %s\n" % repr(entry))
+
+
def main():
# Authenticate with Github
github_auth = Auth.Token(os.environ["GITHUB_TOKEN"])
- grafana_api_key = os.environ["GRAFANA_API_KEY"]
- grafana_metrics_userid = os.environ["GRAFANA_METRICS_USERID"]
+# grafana_api_key = os.environ["GRAFANA_API_KEY"]
+# grafana_metrics_userid = os.environ["GRAFANA_METRICS_USERID"]
# The last workflow this script processed.
# Because the Github queries are broken, we'll simply log a 'processed'
@@ -506,9 +535,10 @@ def main():
github_repo, gh_last_workflows_seen_as_completed
)
- upload_metrics(gh_metrics, grafana_metrics_userid, grafana_api_key)
- logging.info(f"Uploaded {len(gh_metrics)} metrics")
+# upload_metrics(gh_metrics, grafana_metrics_userid, grafana_api_key)
+# logging.info(f"Uploaded {len(gh_metrics)} metrics")
+ dump_local(gh_metrics) ## CAROLINE!!
time.sleep(SCRAPE_INTERVAL_SECONDS)
>From c2548d22621742abe094cc9d64317195068bf652 Mon Sep 17 00:00:00 2001
From: Caroline Tice <cmtice at google.com>
Date: Mon, 25 Aug 2025 14:20:58 -0700
Subject: [PATCH 2/2] Add doc for poking PR testing.
---
libcxx/docs/CarolinesDoc.txt | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 libcxx/docs/CarolinesDoc.txt
diff --git a/libcxx/docs/CarolinesDoc.txt b/libcxx/docs/CarolinesDoc.txt
new file mode 100644
index 0000000000000..59160eeda15c1
--- /dev/null
+++ b/libcxx/docs/CarolinesDoc.txt
@@ -0,0 +1,2 @@
+This is just a test document, for poking the PR and causing it to run the
+libc++ premerge tests.
More information about the libcxx-commits
mailing list