diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /app/workers/concerns | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'app/workers/concerns')
-rw-r--r-- | app/workers/concerns/application_worker.rb | 2 | ||||
-rw-r--r-- | app/workers/concerns/limited_capacity/worker.rb | 7 | ||||
-rw-r--r-- | app/workers/concerns/reenqueuer.rb | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/app/workers/concerns/application_worker.rb b/app/workers/concerns/application_worker.rb index 30dec5159a2..d101ef100d8 100644 --- a/app/workers/concerns/application_worker.rb +++ b/app/workers/concerns/application_worker.rb @@ -19,7 +19,7 @@ module ApplicationWorker def structured_payload(payload = {}) context = Labkit::Context.current.to_h.merge( - 'class' => self.class, + 'class' => self.class.name, 'job_status' => 'running', 'queue' => self.class.queue, 'jid' => jid 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), diff --git a/app/workers/concerns/reenqueuer.rb b/app/workers/concerns/reenqueuer.rb index bf6f6546c03..6f399b6d90b 100644 --- a/app/workers/concerns/reenqueuer.rb +++ b/app/workers/concerns/reenqueuer.rb @@ -13,7 +13,7 @@ # - `#lease_timeout` # # The worker spec should include `it_behaves_like 'reenqueuer'` and -# `it_behaves_like 'it is rate limited to 1 call per'`. +# `it_behaves_like '#perform is rate limited to 1 call per'`. # # Optionally override `#minimum_duration` to adjust the rate limit. # |