Sha256: 5fb3ba239db6c7ab418287a7ef187dcf38c071ddfa99fab95cc273f9b937ffca

Contents?: true

Size: 1.6 KB

Versions: 9

Compression:

Stored size: 1.6 KB

Contents

module NewRelic
  module Agent
    module Instrumentation
      module Rails3
        module ActionController
          def self.newrelic_write_attr(attr_name, value) # :nodoc:
            write_inheritable_attribute(attr_name, value)
          end

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

          # determine the path that is used in the metric name for
          # the called controller action
          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

          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, :params => request.filtered_parameters, :class_name => self.class.name)  do
              super
            end
          end

        end
      end
    end
  end
end

if defined?(ActionController) && defined?(ActionController::Base)
  class ActionController::Base
    include NewRelic::Agent::Instrumentation::ControllerInstrumentation
    include NewRelic::Agent::Instrumentation::Rails3::ActionController
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
newrelic_rpm-2.13.4.rum6 lib/new_relic/agent/instrumentation/rails3/action_controller.rb
newrelic_rpm-2.13.4.rum5 lib/new_relic/agent/instrumentation/rails3/action_controller.rb
newrelic_rpm-2.13.4.rum4 lib/new_relic/agent/instrumentation/rails3/action_controller.rb
newrelic_rpm-2.13.4.eum3 lib/new_relic/agent/instrumentation/rails3/action_controller.rb
newrelic_rpm-2.13.4.eum2 lib/new_relic/agent/instrumentation/rails3/action_controller.rb
newrelic_rpm-2.13.4.eum1 lib/new_relic/agent/instrumentation/rails3/action_controller.rb
newrelic_rpm-2.13.4 lib/new_relic/agent/instrumentation/rails3/action_controller.rb
newrelic_rpm-2.13.3 lib/new_relic/agent/instrumentation/rails3/action_controller.rb
newrelic_rpm-2.13.3.beta lib/new_relic/agent/instrumentation/rails3/action_controller.rb