Module: ActionController::Instrumentation

Defined in:
lib/caliper/rails/instrumentation.rb

Instance Method Summary collapse

Instance Method Details

#process_action(action, *args) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/caliper/rails/instrumentation.rb', line 4

def process_action(action, *args)
  raw_payload = {
    :controller => self.class.name,
    :action     => self.action_name,
    :params     => request.filtered_parameters,
    :formats    => request.formats.map(&:to_sym),
    :method     => request.method,
    :path       => (request.fullpath rescue "unknown"),

    # Need payload to reference the request env tracer
    :caliper_tracer     => request.env['caliper.tracer']
  }

  ActiveSupport::Notifications.instrument("start_processing.action_controller", raw_payload.dup)

  ActiveSupport::Notifications.instrument("process_action.action_controller", raw_payload) do |payload|
    result = super
    payload[:status] = response.status
    append_info_to_payload(payload)
    result
  end
end