Sha256: 18ef07fb025ab21ecd81f3d03ed6f82cae2a5934d25f5dfd55b2a9bb956ff7eb

Contents?: true

Size: 398 Bytes

Versions: 1

Compression:

Stored size: 398 Bytes

Contents

require 'vizsla/background_timer'
require 'vizsla/puppet_master'

module Vizsla
  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

1 entries across 1 versions & 1 rubygems

Version Path
tracebin-0.0.7 lib/vizsla/background_job_instrumentation/sidekiq.rb