Class: Railswatch::Models::DelayedJobRecord

Inherits:
BaseRecord show all
Defined in:
lib/railswatch/models/delayed_job_record.rb

Instance Method Summary collapse

Methods inherited from BaseRecord

#datetime, #datetime=, #datetimei, #datetimei=, #value

Methods inherited from ApplicationRecord

reset_storage_connection!

Instance Method Details

#durationObject



10
11
12
# File 'lib/railswatch/models/delayed_job_record.rb', line 10

def duration
  duration_ms
end

#duration=(value) ⇒ Object



14
15
16
# File 'lib/railswatch/models/delayed_job_record.rb', line 14

def duration=(value)
  self.duration_ms = value
end

#payload_hashObject



18
19
20
# File 'lib/railswatch/models/delayed_job_record.rb', line 18

def payload_hash
  { 'duration' => duration_ms }
end

#record_hashObject

rubocop:disable Metrics/MethodLength



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/railswatch/models/delayed_job_record.rb', line 22

def record_hash # rubocop:disable Metrics/MethodLength
  {
    jid: jid,
    datetime: occurred_at,
    datetimei: occurred_at.to_i,
    duration: duration_ms,
    status: status,
    source_type: source_type,
    class_name: class_name,
    method_name: method_name,
    job_args: job_args,
    error_message: error_message,
    error_backtrace: error_backtrace
  }
end