class RailsPerformance::Models::BaseRecord

Public Class Methods

from_db(key, value) click to toggle source
# File lib/rails_performance/models/base_record.rb, line 4
def self.from_db(key, value)
  raise 'implement me'
end

Public Instance Methods

duration() click to toggle source
# File lib/rails_performance/models/base_record.rb, line 20
def duration
  value['duration']
end
record_hash() click to toggle source
# File lib/rails_performance/models/base_record.rb, line 12
def record_hash
  raise 'implement me'
end
save() click to toggle source
# File lib/rails_performance/models/base_record.rb, line 8
def save
  raise 'implement me'
end
value() click to toggle source
# File lib/rails_performance/models/base_record.rb, line 16
def value
  @value ||= JSON.parse(@json || "{}")
end

Private Instance Methods

ms(e) click to toggle source
# File lib/rails_performance/models/base_record.rb, line 26
def ms(e)
  if e
    e.to_f.round(1).to_s + " ms"
  else
    nil
  end
end