]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
supervisor: Add instrumentation for reimaging time
authorZack Cerza <zack@redhat.com>
Thu, 9 Mar 2023 19:40:15 +0000 (12:40 -0700)
committerZack Cerza <zack@redhat.com>
Wed, 22 Mar 2023 15:52:10 +0000 (09:52 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/dispatcher/supervisor.py
teuthology/exporter.py

index 13c43a6c09618a336bcd99800772998a1fbc2fee..595193c85e86d70a139ceecc78ed969345d02229 100644 (file)
@@ -45,7 +45,17 @@ def main(args):
 
     # reimage target machines before running the job
     if 'targets' in job_config:
-        reimage(job_config)
+        node_count = len(job_config["targets"])
+        # If a job (e.g. from the nop suite) doesn't need nodes, avoid
+        # submitting a zero here.
+        if node_count:
+            with exporter.NodeReimagingTime.labels(
+                job_config["machine_type"],
+                node_count
+            ).time():
+                reimage(job_config)
+        else:
+            reimage(job_config)
         with open(config_file_path, 'w') as f:
             yaml.safe_dump(job_config, f, default_flow_style=False)
 
index ef1c3229dac6e8bbbc0ef2f07c0152ede5096fa9..af5126c9b49cdfa1475c84c6a518d4f746f6a512 100644 (file)
@@ -184,7 +184,13 @@ class JobResults(TeuthologyMetric):
 
 NodeLockingTime = Summary(
     "teuthology_node_locking_duration_seconds",
-    "Time spent waiting to lock a node",
+    "Time spent waiting to lock nodes",
+    ["machine_type", "count"],
+)
+
+NodeReimagingTime = Summary(
+    "teuthology_node_reimaging_duration_seconds",
+    "Time spent reimaging nodes",
     ["machine_type", "count"],
 )