Sha256: fcd43a9b9b79a7d25501e95965a18fca1e1ece1ff07697accb3f481bf4fc348c

Contents?: true

Size: 937 Bytes

Versions: 8

Compression:

Stored size: 937 Bytes

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

      # determine the path that is used in the metric name for
      # the called controller action
      def newrelic_metric_path
        "#{controller_name}/#{action_name}"
      end

      protected

      alias_method :perform_action_without_newrelic_trace, :_dispatch
      alias_method :_dispatch, :perform_action_with_newrelic_trace
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
newrelic_rpm-3.9.9.275 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.9.8.273 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.9.7.266 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.9.6.257 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.9.5.251 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.9.4.245 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.9.3.241 lib/new_relic/agent/instrumentation/merb/controller.rb
newrelic_rpm-3.9.2.239 lib/new_relic/agent/instrumentation/merb/controller.rb