Class: Railswatch::Models::CustomRecord

Inherits:
BaseRecord show all
Defined in:
lib/railswatch/models/custom_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



8
9
10
# File 'lib/railswatch/models/custom_record.rb', line 8

def duration
  duration_ms
end

#duration=(value) ⇒ Object



12
13
14
# File 'lib/railswatch/models/custom_record.rb', line 12

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

#payload_hashObject



16
17
18
# File 'lib/railswatch/models/custom_record.rb', line 16

def payload_hash
  { 'duration' => duration_ms }
end

#record_hashObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/railswatch/models/custom_record.rb', line 20

def record_hash
  {
    tag_name: tag_name,
    namespace_name: namespace_name,
    status: status,
    datetimei: occurred_at.to_i,
    datetime: occurred_at,
    duration: duration_ms
  }
end