Sha256: 0488dfc0ef6a7510a7f987ef22b27ee1235a426a62a51709a1828a337a5392e1

Contents?: true

Size: 375 Bytes

Versions: 6

Compression:

Stored size: 375 Bytes

Contents

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

if defined? ::ActiveJob::Base
  ::ActiveJob::Base.around_perform do |job, block|
    @tracebin_timer = ::Tracebin::BackgroundTimer.new job.class.name.split('::').last
    @tracebin_timer.start!

    block.call

    @tracebin_timer.stop!
    ::Tracebin::PuppetMaster.new(@tracebin_timer).process
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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