Commit 79d1b334 authored by Sean McGivern's avatar Sean McGivern

Remove a TODO for UpdateMergeRequestsWorker logging

We now have structured logging that tells us this information in a
better way.
parent 92883b50
...@@ -18,21 +18,7 @@ class UpdateMergeRequestsWorker # rubocop:disable Scalability/IdempotentWorker ...@@ -18,21 +18,7 @@ class UpdateMergeRequestsWorker # rubocop:disable Scalability/IdempotentWorker
user = User.find_by(id: user_id) user = User.find_by(id: user_id)
return unless user return unless user
# TODO: remove this benchmarking when we have rich logging MergeRequests::RefreshService.new(project, user).execute(oldrev, newrev, ref)
time = Benchmark.measure do
MergeRequests::RefreshService.new(project, user).execute(oldrev, newrev, ref)
end
args_log = [
"elapsed=#{time.real}",
"project_id=#{project_id}",
"user_id=#{user_id}",
"oldrev=#{oldrev}",
"newrev=#{newrev}",
"ref=#{ref}"
].join(',')
Rails.logger.info("UpdateMergeRequestsWorker#perform #{args_log}") if time.real > LOG_TIME_THRESHOLD # rubocop:disable Gitlab/RailsLogger
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
end end
...@@ -26,17 +26,5 @@ describe UpdateMergeRequestsWorker do ...@@ -26,17 +26,5 @@ describe UpdateMergeRequestsWorker do
perform perform
end end
context 'when slow' do
before do
stub_const("UpdateMergeRequestsWorker::LOG_TIME_THRESHOLD", -1)
end
it 'logs debug info' do
expect(Rails.logger).to receive(:info).with(a_string_matching(/\AUpdateMergeRequestsWorker#perform.*project_id=#{project.id},user_id=#{user.id},oldrev=#{oldrev},newrev=#{newrev},ref=#{ref}/))
perform
end
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment