Sha256: c7c405a2ef903c4a2f6fb2aad595068d52e92b1bdbec240cadf1223820d9251d

Contents?: true

Size: 1.07 KB

Versions: 61

Compression:

Stored size: 1.07 KB

Contents

require 'set'

DependencyDetection.defer do
  @name = :merb_controller
  
  depends_on do
    defined?(Merb) && defined?(Merb::Controller)
  end
  
  executes do
    NewRelic::Agent.logger.debug '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

61 entries across 61 versions & 4 rubygems

Version Path
newrelic_rpm-3.5.4.35.beta lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.5.4.34 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.5.4.33 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.5.4.31.beta lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.5.4.29.beta lib/new_relic/agent/instrumentation/merb/controller.rb
ghazel-newrelic_rpm-3.5.4 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.5.3.25 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.5.3.24 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.5.2.17 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.5.1.14 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.5.1.14.beta lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.5.1.beta1 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.5.0.1 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.5.1.alpha lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.5.0 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.4.2.1 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.4.2 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.4.2.beta1 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.4.1 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.4.1.beta1 lib/new_relic/agent/instrumentation/merb/controller.rb