Class: AlacrityRails::Probe::ActiveJob

Inherits:
Object
  • Object
show all
Defined in:
lib/alacrity-rails/probe/active_job.rb

Class Method Summary collapse

Class Method Details

.activateObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/alacrity-rails/probe/active_job.rb', line 4

def self.activate
  ActiveSupport::Notifications.subscribe 'enqueue.active_job' do |name, started, finished, unique_id, data|
    AlacrityRails::Client.store_timeline_event(
      name: 'Job Queued',
      event_type: 'job',
      engine: 'ActiveJob',
      started_at: started,
      finished_at: finished,
      detail: data[:job].class.to_s
    )
  end
end