Sha256: bb0fd92331aa0b95c685e3fa0f0b12c56eb0772f7273cd2be7a0b3852092d8d2

Contents?: true

Size: 404 Bytes

Versions: 6

Compression:

Stored size: 404 Bytes

Contents

require 'tracebin/background_timer'
require 'tracebin/puppet_master'

module Tracebin
  module BackgroundJobInstrumentation
    class Sidekiq
      def call(worker, msg, queue, *args)
        timer = BackgroundTimer.new worker.class.name.split('::').last
        timer.start!

        yield

        timer.stop!

        PuppetMaster.new(timer, logger: worker.logger).process
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tracebin-0.0.13 lib/tracebin/background_job_instrumentation/sidekiq.rb
tracebin-0.0.12 lib/tracebin/background_job_instrumentation/sidekiq.rb
tracebin-0.0.11 lib/tracebin/background_job_instrumentation/sidekiq.rb
tracebin-0.0.10 lib/tracebin/background_job_instrumentation/sidekiq.rb
tracebin-0.0.9 lib/tracebin/background_job_instrumentation/sidekiq.rb
tracebin-0.0.8 lib/tracebin/background_job_instrumentation/sidekiq.rb