diff options
Diffstat (limited to 'app/workers/concerns/limited_capacity/worker.rb')
-rw-r--r-- | app/workers/concerns/limited_capacity/worker.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/workers/concerns/limited_capacity/worker.rb b/app/workers/concerns/limited_capacity/worker.rb index c0d6bfff2f5..b5a97e49300 100644 --- a/app/workers/concerns/limited_capacity/worker.rb +++ b/app/workers/concerns/limited_capacity/worker.rb @@ -67,6 +67,7 @@ module LimitedCapacity return unless has_capacity? job_tracker.register(jid) + report_running_jobs_metrics perform_work(*args) rescue => exception raise @@ -108,11 +109,15 @@ module LimitedCapacity end def report_prometheus_metrics(*args) - running_jobs_gauge.set(prometheus_labels, running_jobs_count) + report_running_jobs_metrics remaining_work_gauge.set(prometheus_labels, remaining_work_count(*args)) max_running_jobs_gauge.set(prometheus_labels, max_running_jobs) end + def report_running_jobs_metrics + running_jobs_gauge.set(prometheus_labels, running_jobs_count) + end + def required_jobs_count(*args) [ remaining_work_count(*args), |