]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
supervisor: Add instrumentation for job time
authorZack Cerza <zack@redhat.com>
Thu, 9 Mar 2023 18:38:04 +0000 (11:38 -0700)
committerZack Cerza <zack@redhat.com>
Thu, 9 Mar 2023 23:08:15 +0000 (16:08 -0700)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/dispatcher/supervisor.py
teuthology/exporter.py

index c38118a378f0721e9712b789ff79a1b1b182c854..92443fe6151e9c8cff0e6e9156949c75a4dbd7fc 100644 (file)
@@ -8,6 +8,7 @@ import requests
 from urllib.parse import urljoin
 from datetime import datetime
 
+import teuthology.exporter as exporter
 import teuthology.lock.ops as lock_ops
 import teuthology.nuke as nuke
 
@@ -54,12 +55,13 @@ def main(args):
             yaml.safe_dump(job_config, f, default_flow_style=False)
 
     try:
-        return run_job(
-            job_config,
-            teuth_bin_path,
-            archive_dir,
-            verbose
-        )
+        with exporter.JobTime.labels(job_config["suite"]).time():
+            return run_job(
+                job_config,
+                teuth_bin_path,
+                archive_dir,
+                verbose
+            )
     except SkipJob:
         return 0
 
index d40e55b109a7d661e749097debfac5bc93b3e41c..b3ee9dcf2fb1b8ce06cac398c3d088bab1d64dc2 100644 (file)
@@ -188,6 +188,12 @@ NodeLockingTime = Summary(
     ["machine_type", "count"],
 )
 
+JobTime = Summary(
+    "teuthology_job_duration_seconds",
+    "Time spent executing a job",
+    ["suite"],
+)
+
 
 def main(args):
     exporter = TeuthologyExporter(interval=int(args["--interval"]))