Class: Gitlab::Metrics::SidekiqMiddleware

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/metrics/sidekiq_middleware.rb

Overview

Sidekiq middleware for tracking jobs.

This middleware is intended to be used as a server-side middleware.

Instance Method Summary collapse

Instance Method Details

#call(worker, message, queue) ⇒ Object


7
8
9
10
11
12
13
14
15
# File 'lib/gitlab/metrics/sidekiq_middleware.rb', line 7

def call(worker, message, queue)
  trans = Transaction.new("#{worker.class.name}#perform")

  begin
    trans.run { yield }
  ensure
    trans.finish
  end
end