Class: ActiveInsights::Request
- Inherits:
-
Record
- Object
- ApplicationRecord
- Record
- ActiveInsights::Request
show all
- Defined in:
- app/models/active_insights/request.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Record
#agony, #p50, #p95, #p99, #parsed_durations, #pretty_started_at
Class Method Details
.setup(started, finished, unique_id, payload) ⇒ Object
5
6
7
8
9
10
11
|
# File 'app/models/active_insights/request.rb', line 5
def self.setup(started, finished, unique_id, payload)
create!(started_at: started, ip_address: payload[:request].remote_ip,
finished_at: finished, uuid: unique_id,
http_method: payload[:method],
**payload.slice(:controller, :action, :format, :status,
:view_runtime, :db_runtime, :path))
end
|
Instance Method Details
#percentage(others) ⇒ Object
13
14
15
|
# File 'app/models/active_insights/request.rb', line 13
def percentage(others)
(agony / others.sum(&:agony)) * 100.0
end
|