Class: ActiveInsights::Record
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- ActiveInsights::Record
- Defined in:
- app/models/active_insights/record.rb
Instance Method Summary collapse
- #agony ⇒ Object
- #p50 ⇒ Object
- #p95 ⇒ Object
- #p99 ⇒ Object
- #parsed_durations ⇒ Object
- #pretty_started_at ⇒ Object
Instance Method Details
#agony ⇒ Object
50 51 52 |
# File 'app/models/active_insights/record.rb', line 50 def agony parsed_durations.sum end |
#p50 ⇒ Object
68 69 70 |
# File 'app/models/active_insights/record.rb', line 68 def p50 percentile_value(0.5) end |
#p95 ⇒ Object
72 73 74 |
# File 'app/models/active_insights/record.rb', line 72 def p95 percentile_value(0.95) end |
#p99 ⇒ Object
76 77 78 |
# File 'app/models/active_insights/record.rb', line 76 def p99 percentile_value(0.99) end |
#parsed_durations ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'app/models/active_insights/record.rb', line 54 def parsed_durations return unless respond_to?(:durations) @parsed_durations ||= if durations.is_a?(Array) then durations else JSON.parse(durations) end.sort end |
#pretty_started_at ⇒ Object
64 65 66 |
# File 'app/models/active_insights/record.rb', line 64 def pretty_started_at started_at.strftime("%-l:%M%P") end |