Class: SidekiqStatsInstrumentation::ClientMiddleware

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq_stats_instrumentation/client_middleware.rb

Instance Method Summary collapse

Instance Method Details

#call(worker_class, _job, _queue, _redis_pool) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/sidekiq_stats_instrumentation/client_middleware.rb', line 7

def call(worker_class, _job, _queue, _redis_pool)
  klass = Object.const_get(worker_class.to_s)
  queue_name = klass.get_sidekiq_options['queue']
  worker_name = klass.name.gsub('::', '_')
  StatsD.increment "shared.sidekiq.#{queue_name}.#{worker_name}.enqueue"

  yield
end