Class: Mnemosyne::Probes::ActiveJob::Perform::Probe

Inherits:
Mnemosyne::Probe show all
Defined in:
lib/mnemosyne/probes/active_job/perform.rb

Instance Method Summary collapse

Methods inherited from Mnemosyne::Probe

#install, #setup, subscribe, subscriptions

Methods included from Logging

#logger

Instance Method Details

#call(trace, _name, start, finish, _id, payload) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/mnemosyne/probes/active_job/perform.rb', line 10

def call(trace, _name, start, finish, _id, payload)
  start  = ::Mnemosyne::Clock.to_tick(start)
  finish = ::Mnemosyne::Clock.to_tick(finish)

  job = payload[:job]

  meta = {
    id: job.job_id,
    job: job.class.name,
    arguments: job.arguments,
    queue: job.queue_name
  }

  span = ::Mnemosyne::Span.new(
    'app.job.perform.active_job',
    start:,
    finish:,
    meta:
  )

  trace << span
end