Class: Epilog::Rails::ActiveJobSubscriber

Inherits:
LogSubscriber
  • Object
show all
Defined in:
lib/epilog/rails/active_job_subscriber.rb

Instance Attribute Summary

Attributes inherited from LogSubscriber

#logger

Instance Method Summary collapse

Methods inherited from LogSubscriber

#initialize

Constructor Details

This class inherits a constructor from Epilog::Rails::LogSubscriber

Instance Method Details

#enqueue(event) ⇒ Object



6
7
8
# File 'lib/epilog/rails/active_job_subscriber.rb', line 6

def enqueue(event)
  info { event_hash('Enqueued job', event) }
end

#enqueue_at(event) ⇒ Object



10
11
12
# File 'lib/epilog/rails/active_job_subscriber.rb', line 10

def enqueue_at(event)
  enqueue(event)
end

#perform(event) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/epilog/rails/active_job_subscriber.rb', line 18

def perform(event)
  info do
    event_hash('Performed job', event).merge(
      metrics: {
        job_runtime: event.duration
      }
    )
  end
end

#perform_start(event) ⇒ Object



14
15
16
# File 'lib/epilog/rails/active_job_subscriber.rb', line 14

def perform_start(event)
  info { event_hash('Performing job', event) }
end