Class: ActiveRecordQueryStats::Summary
- Inherits:
-
Object
- Object
- ActiveRecordQueryStats::Summary
- Defined in:
- lib/active_record_query_stats/summary.rb
Constant Summary collapse
- STATS =
%i[ total real cached select insert update delete transaction savepoint lock rollback other ].freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Summary
constructor
A new instance of Summary.
- #to_payload ⇒ Object
Constructor Details
Class Method Details
.call ⇒ Object
11 12 13 |
# File 'lib/active_record_query_stats/summary.rb', line 11 def self.call RequestStore[:active_record_query_stats] ||= new end |
Instance Method Details
#to_payload ⇒ Object
31 32 33 34 35 |
# File 'lib/active_record_query_stats/summary.rb', line 31 def to_payload STATS.each_with_object({}) do |field, memo| memo[field] = try field end end |