Class: SystemMetrics::Instrument::ActiveRecord
- Defined in:
- lib/system_metrics/instrument/active_record.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #ignore?(event) ⇒ Boolean
-
#initialize ⇒ ActiveRecord
constructor
A new instance of ActiveRecord.
- #prepare(event) ⇒ Object
Methods inherited from Base
#handles?, #mapped_paths, #prune_path
Constructor Details
#initialize ⇒ ActiveRecord
Returns a new instance of ActiveRecord.
5 6 7 |
# File 'lib/system_metrics/instrument/active_record.rb', line 5 def initialize super /\.active_record$/ end |
Instance Method Details
#ignore?(event) ⇒ Boolean
9 10 11 |
# File 'lib/system_metrics/instrument/active_record.rb', line 9 def ignore?(event) event.payload[:sql] !~ /^(SELECT|INSERT|UPDATE|DELETE)/ end |
#prepare(event) ⇒ Object
13 14 15 16 |
# File 'lib/system_metrics/instrument/active_record.rb', line 13 def prepare(event) event.payload[:sql] = event.payload[:sql].squeeze(" ") event.payload.delete(:connection_id) end |