Class: Signalman::QueryHandler

Inherits:
BaseHandler show all
Defined in:
lib/signalman.rb

Constant Summary collapse

IGNORED_QUERIES =
[
  "SCHEMA",
  "TRANSACTION",
  "ActiveRecord::SchemaMigration",
  "ActiveRecord::InternalMetadata",
  /^Signalman/
]

Instance Attribute Summary

Attributes inherited from BaseHandler

#current_time, #event

Instance Method Summary collapse

Methods inherited from BaseHandler

call, #create_event, #finished_at, #initialize, #start, #started_at

Constructor Details

This class inherits a constructor from Signalman::BaseHandler

Instance Method Details

#processObject



107
108
109
# File 'lib/signalman.rb', line 107

def process
  create_event event.payload.except(:connection)
end

#skip?Boolean

CREATE_TABLE queries have nil for ‘name`

Returns:

  • (Boolean)


102
103
104
105
# File 'lib/signalman.rb', line 102

def skip?
  return if event.payload[:name].blank?
  IGNORED_QUERIES.any?{ |q| q.match? event.payload[:name] }
end