diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-06-23 08:21:50 +0300 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-06-23 14:09:52 +0300 |
commit | 9101915cb7a2ff2497b5b6bcde1e46220728471c (patch) | |
tree | 20e77e105913bd7f8ac6b90c3b4062f440b2eb3d /lib | |
parent | 62948886fbec12f54563f738ccdb9be4a87ad349 (diff) |
Add Sidekiq queue duration to transaction metrics.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/metrics/sidekiq_middleware.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/gitlab/metrics/sidekiq_middleware.rb b/lib/gitlab/metrics/sidekiq_middleware.rb index fd98aa3412e..a1240fd33ee 100644 --- a/lib/gitlab/metrics/sidekiq_middleware.rb +++ b/lib/gitlab/metrics/sidekiq_middleware.rb @@ -8,6 +8,8 @@ module Gitlab trans = Transaction.new("#{worker.class.name}#perform") begin + # Old gitlad-shell messages don't provide enqueued_at/created_at attributes + trans.set(:sidekiq_queue_duration, Time.now.to_f - (message['enqueued_at'] || message['created_at'] || 0)) trans.run { yield } ensure trans.finish |