Module: NewRelic::Agent::Instrumentation::Rails3::ActionController

Defined in:
lib/new_relic/agent/instrumentation/rails3/action_controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.newrelic_read_attr(attr_name) ⇒ Object

:nodoc:



10
11
12
# File 'lib/new_relic/agent/instrumentation/rails3/action_controller.rb', line 10

def self.newrelic_read_attr(attr_name) # :nodoc:
  read_inheritable_attribute(attr_name)
end

.newrelic_write_attr(attr_name, value) ⇒ Object

:nodoc:



6
7
8
# File 'lib/new_relic/agent/instrumentation/rails3/action_controller.rb', line 6

def self.newrelic_write_attr(attr_name, value) # :nodoc:
  write_inheritable_attribute(attr_name, value)
end

Instance Method Details

#newrelic_metric_path(action_name_override = nil) ⇒ Object

determine the path that is used in the metric name for the called controller action



16
17
18
19
20
21
22
23
# File 'lib/new_relic/agent/instrumentation/rails3/action_controller.rb', line 16

def newrelic_metric_path(action_name_override = nil)
  action_part = action_name_override || action_name
  if action_name_override || self.class.action_methods.include?(action_part)
    "#{self.class.controller_path}/#{action_part}"
  else
    "#{self.class.controller_path}/(other)"
  end
end

#process_action(*args) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/new_relic/agent/instrumentation/rails3/action_controller.rb', line 25

def process_action(*args)
  # skip instrumentation if we are in an ignored action
  if _is_filtered?('do_not_trace')
    NewRelic::Agent.disable_all_tracing do
      return super
    end
  end

  perform_action_with_newrelic_trace(:category => :controller, :name => self.action_name, :path => newrelic_metric_path, :params => request.filtered_parameters, :class_name => self.class.name)  do
    super
  end
end