Sha256: c70029a02afb9893946d7fb409f7e82262c518a4e84641a9b075519da42d3ddf

Contents?: true

Size: 1.28 KB

Versions: 35

Compression:

Stored size: 1.28 KB

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
require 'new_relic/agent/instrumentation/action_controller_subscriber'

module NewRelic
  module Agent
    module Instrumentation
      module Rails4
        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
        end
      end
    end
  end
end

DependencyDetection.defer do
  @name = :rails4_controller

  depends_on do
    defined?(::Rails) && ::Rails::VERSION::MAJOR.to_i == 4
  end

  depends_on do
    defined?(ActionController) && defined?(ActionController::Base)
  end

  executes do
    ::NewRelic::Agent.logger.info 'Installing Rails 4 Controller instrumentation'
  end

  executes do
    class ActionController::Base
      include NewRelic::Agent::Instrumentation::ControllerInstrumentation
      include NewRelic::Agent::Instrumentation::Rails4::ActionController
    end
    NewRelic::Agent::Instrumentation::ActionControllerSubscriber \
      .subscribe(/^process_action.action_controller$/)
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
newrelic_rpm-3.9.1.236 lib/new_relic/agent/instrumentation/rails4/action_controller.rb
newrelic_rpm-3.9.0.229 lib/new_relic/agent/instrumentation/rails4/action_controller.rb
newrelic_rpm-3.8.1.221 lib/new_relic/agent/instrumentation/rails4/action_controller.rb
newrelic_rpm-3.8.0.218 lib/new_relic/agent/instrumentation/rails4/action_controller.rb
newrelic_rpm-3.7.3.204 lib/new_relic/agent/instrumentation/rails4/action_controller.rb
newrelic_rpm-3.7.3.199 lib/new_relic/agent/instrumentation/rails4/action_controller.rb
newrelic_rpm-3.7.2.195 lib/new_relic/agent/instrumentation/rails4/action_controller.rb
newrelic_rpm-3.7.2.192 lib/new_relic/agent/instrumentation/rails4/action_controller.rb
newrelic_rpm-3.7.2.190.beta lib/new_relic/agent/instrumentation/rails4/action_controller.rb
newrelic_rpm-3.7.1.188 lib/new_relic/agent/instrumentation/rails4/action_controller.rb
newrelic_rpm-3.7.1.182 lib/new_relic/agent/instrumentation/rails4/action_controller.rb
newrelic_rpm-3.7.1.180 lib/new_relic/agent/instrumentation/rails4/action_controller.rb
newrelic_rpm-3.7.0.177 lib/new_relic/agent/instrumentation/rails4/action_controller.rb
newrelic_rpm-3.7.0.174.beta lib/new_relic/agent/instrumentation/rails4/action_controller.rb
newrelic_rpm-3.6.9.171 lib/new_relic/agent/instrumentation/rails4/action_controller.rb
newrelic_rpm-3.6.8.168 lib/new_relic/agent/instrumentation/rails4/action_controller.rb
newrelic_rpm-3.6.8.164 lib/new_relic/agent/instrumentation/rails4/action_controller.rb
newrelic_rpm-3.6.7.159 lib/new_relic/agent/instrumentation/rails4/action_controller.rb
newrelic_rpm-3.6.7.159.beta lib/new_relic/agent/instrumentation/rails4/action_controller.rb
newrelic_rpm-3.6.7.152 lib/new_relic/agent/instrumentation/rails4/action_controller.rb