Class: SystemMetrics::Instrument::ActionController

Inherits:
Base
  • Object
show all
Defined in:
lib/system_metrics/instrument/action_controller.rb

Instance Attribute Summary

Attributes inherited from Base

#pattern

Instance Method Summary collapse

Methods inherited from Base

#handles?, #mapped_paths, #prune_path

Constructor Details

#initializeActionController

Returns a new instance of ActionController.



5
6
7
# File 'lib/system_metrics/instrument/action_controller.rb', line 5

def initialize
  super /\.action_controller$/
end

Instance Method Details

#ignore?(event) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/system_metrics/instrument/action_controller.rb', line 9

def ignore?(event)
  event.name != 'process_action.action_controller'
end

#prepare(event) ⇒ Object



13
14
15
16
# File 'lib/system_metrics/instrument/action_controller.rb', line 13

def prepare(event)
  event.payload[:end_point] = "#{event.payload.delete(:controller)}##{event.payload.delete(:action)}"
  event.payload.slice!(:path, :method, :params, :db_runtime, :view_runtime, :end_point)
end