class Nightwing::Sidekiq::Stats
Public Instance Methods
call(_worker, _msg, _queue) { || ... }
click to toggle source
Sends Sidekiq
metrics to statsd client then yields
@param [Sidekiq::Worker] _worker
The worker the job belongs to.
@param [Hash] _msg
The job message.
@param [String] _queue
The current queue.
# File lib/nightwing/sidekiq/stats.rb, line 19 def call(_worker, _msg, _queue) client.measure "#{namespace}.retries", retries.size client.measure "#{namespace}.scheduled", scheduled.size client.increment "#{namespace}.processed" begin yield rescue client.increment "#{namespace}.failed" raise end end
Private Instance Methods
retries()
click to toggle source
# File lib/nightwing/sidekiq/stats.rb, line 34 def retries @_retries ||= ::Sidekiq::RetrySet.new end
scheduled()
click to toggle source
# File lib/nightwing/sidekiq/stats.rb, line 38 def scheduled @_scheduled ||= ::Sidekiq::ScheduledSet.new end