Sha256: 939c82fd9b286ea6c7e4fc7d44d8091a115327a8ac2de68112bb2dc57b22a126

Contents?: true

Size: 882 Bytes

Versions: 8

Compression:

Stored size: 882 Bytes

Contents

# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

module NewRelic::Agent::Instrumentation
  module <%= @class_name %>
    def self.instrument!
      ::<%= @class_name %>.class_eval do
        include NewRelic::Agent::Instrumentation::<%= @class_name %>

        alias_method(:<%= @method.downcase %>_without_new_relic, :<%= @method.downcase %>)
        alias_method(:<%= @method.downcase %>, :<%= @method.downcase %>_with_new_relic)

        def <%= @method.downcase %><%= "(#{@args})" unless @args.empty? %>
          <%= @method.downcase %>_with_new_relic<%= "(#{@args})" unless @args.empty? %> do
            <%= @method.downcase %>_without_new_relic<%= "(#{@args})" unless @args.empty? %>
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
newrelic_rpm-9.1.0 lib/tasks/instrumentation_generator/templates/chain.tt
newrelic_rpm-9.0.0 lib/tasks/instrumentation_generator/templates/chain.tt
newrelic_rpm-8.16.0 lib/tasks/instrumentation_generator/templates/chain.tt
newrelic_rpm-8.15.0 lib/tasks/instrumentation_generator/templates/chain.tt
newrelic_rpm-8.14.0 lib/tasks/instrumentation_generator/templates/chain.tt
newrelic_rpm-8.13.1 lib/tasks/instrumentation_generator/templates/chain.tt
newrelic_rpm-8.13.0 lib/tasks/instrumentation_generator/templates/chain.tt
newrelic_rpm-8.12.0 lib/tasks/instrumentation_generator/templates/chain.tt