99BASTION_DOWNLOAD_JOB_ALL_SECONDS = Histogram (
1010 "bastion_download_job_all_seconds" ,
1111 "Time in seconds consumed in each scheduling loop to download all the job specs" ,
12- [],
1312 buckets = (1 , 5 , 10 , 30 , 60 , 120 , 300 , 600 , 1800 , 3600 ), # 1s to 1hr
1413)
1514
1615JOB_TIME_TO_RUNNING_SECONDS = Histogram (
1716 "bastion_job_time_to_running_seconds" ,
1817 "Time in seconds from runner starts a job until until it reaches Running state" ,
19- ["job_name" ],
2018 buckets = (1 , 5 , 10 , 30 , 60 , 120 , 300 , 600 , 1800 , 3600 ), # 1s to 1hr
2119)
2220
3533JOB_SUSPENDED_DURATION_SECONDS = Histogram (
3634 "bastion_job_suspended_duration_seconds" ,
3735 "Time in seconds the jobset stayed in SUSPENDED state" ,
38- ["job_name" ],
3936 buckets = (1 , 5 , 10 , 30 , 60 , 120 , 300 , 600 , 1800 , 3600 ), # 1s to 1hr
4037)
4138
@@ -115,15 +112,14 @@ def get_multiprocess_dir(cls) -> str:
115112 return cls ._multiprocess_dir
116113
117114
118- def record_job_time_to_running (job_name : str , time_seconds : float ):
115+ def record_job_time_to_running (time_seconds : float ):
119116 """Record the time it took for a job to reach RUNNING state.
120117
121118 Args:
122119 job_name: Name of the job
123120 time_seconds: Time in seconds from first seen until RUNNING state
124121 """
125- JOB_TIME_TO_RUNNING_SECONDS .labels (job_name = job_name ).observe (time_seconds )
126- logging .info ("Metrics: job %s took %.2f seconds to reach RUNNING state" , job_name , time_seconds )
122+ JOB_TIME_TO_RUNNING_SECONDS .observe (time_seconds )
127123
128124
129125def record_job_run_latency (job_name : str , time_seconds : float ):
@@ -141,15 +137,14 @@ def record_job_wait_for_build(job_name: str, time_seconds: float):
141137 JOB_WAIT_FOR_BUILD_SECONDS .labels (job_name ).set (time_seconds )
142138
143139
144- def record_job_suspended_duration (job_name : str , time_seconds : float ):
140+ def record_job_suspended_duration (time_seconds : float ):
145141 """Record the time a job spent in SUSPENDED state.
146142
147143 Args:
148144 job_name: Name of the job
149145 time_seconds: Time in seconds the job was in SUSPENDED state
150146 """
151- JOB_SUSPENDED_DURATION_SECONDS .labels (job_name = job_name ).observe (time_seconds )
152- logging .info ("Metrics: job %s was in SUSPENDED state for %.2f seconds" , job_name , time_seconds )
147+ JOB_SUSPENDED_DURATION_SECONDS .observe (time_seconds )
153148
154149
155150def cleanup (pid = None ):
0 commit comments