Class: QueryTrack::EventProcessor
- Inherits:
-
Object
- Object
- QueryTrack::EventProcessor
- Defined in:
- lib/query_track/event_processor.rb
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
Returns the value of attribute event.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(event) ⇒ EventProcessor
constructor
A new instance of EventProcessor.
Constructor Details
#initialize(event) ⇒ EventProcessor
Returns a new instance of EventProcessor.
5 6 7 |
# File 'lib/query_track/event_processor.rb', line 5 def initialize(event) @event = event end |
Instance Attribute Details
#event ⇒ Object (readonly)
Returns the value of attribute event.
3 4 5 |
# File 'lib/query_track/event_processor.rb', line 3 def event @event end |
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/query_track/event_processor.rb', line 9 def call return unless QueryTrack::Settings.config.duration return if under_filter?(caller) if event.duration > QueryTrack::Settings.config.duration QueryTrack::Notifications::Slack.new(event.payload[:sql], event.duration).call QueryTrack::Notifications::Log.new(event.payload[:sql], event.duration).call end end |