diff options
author | micael.bergeron <micaelbergeron@gmail.com> | 2017-11-13 14:56:08 -0500 |
---|---|---|
committer | micael.bergeron <micaelbergeron@gmail.com> | 2017-11-13 14:56:08 -0500 |
commit | bae6385bda13f1db0083ef834aedcc89424e0130 (patch) | |
tree | 83691e9f5cda5e3219d1e548daeec8bcf7caee9a /app/workers | |
parent | 9200b500125d15a56d10e66c9bcd78943e4386b1 (diff) | |
download | gitlab-ce-bae6385bda13f1db0083ef834aedcc89424e0130.tar.gz |
add simple logging to UpdateMergeRequestsWorker#perform
this is to try to debug #35914
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/update_merge_requests_worker.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/workers/update_merge_requests_worker.rb b/app/workers/update_merge_requests_worker.rb index 89ae17cef37..d8d818aee8e 100644 --- a/app/workers/update_merge_requests_worker.rb +++ b/app/workers/update_merge_requests_worker.rb @@ -9,6 +9,17 @@ class UpdateMergeRequestsWorker user = User.find_by(id: user_id) return unless user - MergeRequests::RefreshService.new(project, user).execute(oldrev, newrev, ref) + # TODO: remove this benchmarking when we have rich logging + time = Benchmark.measure do + MergeRequests::RefreshService.new(project, user).execute(oldrev, newrev, ref) + end + + log_args = ["elapsed=#{time.real}"] + method(__method__).parameters.map do |_, p| + pname = p.to_s + log_args << [pname, binding.local_variable_get(pname)].join('=') + end + + Rails.logger.info("UpdateMergeRequestsWorker#perform #{log_args.join(',')}") end end |