Sha256: 683c4a8472aefbd5e0974ce449feee1c7530642ae6a761edf421041fb6689641

Contents?: true

Size: 1.23 KB

Versions: 17

Compression:

Stored size: 1.23 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 'set'

DependencyDetection.defer do
  @name = :merb_controller
  
  depends_on do
    defined?(Merb) && defined?(Merb::Controller)
  end
  
  executes do
    ::NewRelic::Agent.logger.info 'Installing Merb Controller instrumentation'
  end
  
  executes do
    require 'merb-core/controller/merb_controller'

    Merb::Controller.class_eval do
      include NewRelic::Agent::Instrumentation::ControllerInstrumentation

      class_inheritable_accessor :do_not_trace
      class_inheritable_accessor :ignore_apdex

      def self.newrelic_write_attr(attr_name, value) # :nodoc:
        self.send "#{attr_name}=", attr_name, value
      end

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

      protected
      # determine the path that is used in the metric name for
      # the called controller action
      def newrelic_metric_path
        "#{controller_name}/#{action_name}"
      end
      alias_method :perform_action_without_newrelic_trace, :_dispatch
      alias_method :_dispatch, :perform_action_with_newrelic_trace
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
newrelic_rpm-3.6.5.130 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.6.4.122 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.6.4.113.beta lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.6.3.111 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.6.3.106 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.6.3.105.beta lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.6.3.104 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.6.3.103.beta lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.6.2.96 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.6.2.90.beta lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.6.1.88 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.6.1.87 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.6.1.86.beta lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.6.1.85.beta lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.6.0.83 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.6.0.78 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.6.0.74.beta lib/new_relic/agent/instrumentation/merb/controller.rb