Class: Delayed::Plugins::Instrumentation

Inherits:
Delayed::Plugin show all
Defined in:
lib/delayed/plugins/instrumentation.rb

Class Method Summary collapse

Methods inherited from Delayed::Plugin

callbacks, #initialize

Constructor Details

This class inherits a constructor from Delayed::Plugin

Class Method Details

.active_support_notifications_tags(job) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/delayed/plugins/instrumentation.rb', line 26

def self.active_support_notifications_tags(job)
  {
    job_name: job.name,
    priority: job.priority,
    queue: job.queue,
    table: job.class.table_name,
    database: job.class.database_name,
    database_adapter: job.class.database_adapter_name,
    job: job,
  }
end

.bulk_enqueue_tags(jobs) ⇒ Object



38
39
40
41
42
# File 'lib/delayed/plugins/instrumentation.rb', line 38

def self.bulk_enqueue_tags(jobs)
  {
    jobs: jobs.map { |job| active_support_notifications_tags(job) },
  }
end