# 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)
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"],
)