Class: Railswatch::Reports::SlowRequestsReport
- Inherits:
-
BaseReport
- Object
- BaseReport
- Railswatch::Reports::SlowRequestsReport
- Defined in:
- lib/railswatch/reports/slow_requests_report.rb
Instance Attribute Summary
Attributes inherited from BaseReport
Instance Method Summary collapse
Methods inherited from BaseReport
#initialize, #nil_data, #nullify_data, #set_defaults, time_in_app_time_zone
Constructor Details
This class inherits a constructor from Railswatch::Reports::BaseReport
Instance Method Details
#data ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/railswatch/reports/slow_requests_report.rb', line 6 def data db.where('occurred_at > ?', Railswatch.slow_requests_time_window.ago) .where('duration_ms > ?', Railswatch.slow_requests_threshold.to_f) .order(occurred_at: :desc) .limit(limit) .map(&:record_hash) end |