[llvm] [CI] Upstream metrics script and container definition (PR #117461)

Nathan Gauër via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 25 04:49:13 PST 2024


================
@@ -0,0 +1,180 @@
+import requests
+import time
+import os
+from dataclasses import dataclass
+
+from github import Github
+from github import Auth
+
+GRAFANA_URL = (
+    "https://influx-prod-13-prod-us-east-0.grafana.net/api/v1/push/influx/write"
+)
+GITHUB_PROJECT = "llvm/llvm-project"
+WORKFLOWS_TO_TRACK = ["Check code formatting"]
+
+
+ at dataclass
+class JobMetrics:
+    job_name: str
+    queue_time: int
+    run_time: int
+    status: int
+    created_at_ns: int
+    workflow_id: int
+
+
+def get_metrics(github_repo, workflows_to_track):
----------------
Keenuts wrote:

```suggestion
def get_metrics(github_repo : github.Repository, workflows_to_track : dict[str, int]):
```

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


More information about the llvm-commits mailing list