[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:52 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {darker}-->


:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r HEAD~1...HEAD .ci/metrics/metrics.py
``````````

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- metrics.py	2025-08-25 21:16:38.000000 +0000
+++ metrics.py	2025-08-25 21:21:26.359881 +0000
@@ -344,12 +344,13 @@
                 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]
-
+                    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:
@@ -507,20 +508,20 @@
     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:
+    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'
     # bit for the last COUNT_TO_PROCESS workflows.
     gh_last_workflows_seen_as_completed = set()
@@ -533,14 +534,14 @@
 
         gh_metrics, gh_last_workflows_seen_as_completed = github_get_metrics(
             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")
-
-        dump_local(gh_metrics) ## CAROLINE!!
+        #        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)
 
 
 if __name__ == "__main__":
     logging.basicConfig(level=logging.INFO)

``````````

</details>


https://github.com/llvm/llvm-project/pull/155298


More information about the libcxx-commits mailing list