Adds instrumentation to several ends in ActionController::Base. It also provides some hooks related with process_action, this allows an ORM like Active Record and/or DataMapper to plug in ActionController and show related information.
Check ActiveRecord::Railties::ControllerRuntime for an example.
# File lib/action_controller/metal/instrumentation.rb, line 17
17: def process_action(action, *args)
18: raw_payload = {
19: :controller => self.class.name,
20: :action => self.action_name,
21: :params => request.filtered_parameters,
22: :formats => request.formats.map(&:to_sym),
23: :method => request.method,
24: :path => (request.fullpath rescue "unknown")
25: }
26:
27: ActiveSupport::Notifications.instrument("start_processing.action_controller", raw_payload.dup)
28:
29: ActiveSupport::Notifications.instrument("process_action.action_controller", raw_payload) do |payload|
30: result = super
31: payload[:status] = response.status
32: append_info_to_payload(payload)
33: result
34: end
35: end
# File lib/action_controller/metal/instrumentation.rb, line 58
58: def redirect_to(*args)
59: ActiveSupport::Notifications.instrument("redirect_to.action_controller") do |payload|
60: result = super
61: payload[:status] = self.status
62: payload[:location] = self.location
63: result
64: end
65: end
# File lib/action_controller/metal/instrumentation.rb, line 37
37: def render(*args)
38: render_output = nil
39: self.view_runtime = cleanup_view_runtime do
40: Benchmark.ms { render_output = super }
41: end
42: render_output
43: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.