From: Zack Cerza Date: Thu, 9 Mar 2023 18:38:04 +0000 (-0700) Subject: supervisor: Add instrumentation for job time X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b20a7c4fd5e34f46a0cb7c7195e9e88682c368ee;p=teuthology.git supervisor: Add instrumentation for job time Signed-off-by: Zack Cerza --- diff --git a/teuthology/dispatcher/supervisor.py b/teuthology/dispatcher/supervisor.py index c38118a378..92443fe615 100644 --- a/teuthology/dispatcher/supervisor.py +++ b/teuthology/dispatcher/supervisor.py @@ -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 diff --git a/teuthology/exporter.py b/teuthology/exporter.py index d40e55b109..b3ee9dcf2f 100644 --- a/teuthology/exporter.py +++ b/teuthology/exporter.py @@ -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"]))