lib/new_relic/agent/datastores.rb in newrelic_rpm-8.9.0 vs lib/new_relic/agent/datastores.rb in newrelic_rpm-8.10.0
- old
+ new
@@ -1,8 +1,9 @@
# encoding: utf-8
# 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
require 'new_relic/agent/datastores/metric_helper'
module NewRelic
module Agent
@@ -41,11 +42,11 @@
if NewRelic::Helper.instance_methods_include?(klass, method_name) &&
!NewRelic::Helper.instance_methods_include?(klass, method_name_without_newrelic)
visibility = NewRelic::Helper.instance_method_visibility(klass, method_name)
- alias_method method_name_without_newrelic, method_name
+ alias_method(method_name_without_newrelic, method_name)
define_method(method_name) do |*args, &blk|
segment = NewRelic::Agent::Tracer.start_datastore_segment(
product: product,
operation: operation
@@ -55,11 +56,11 @@
ensure
segment.finish if segment
end
end
- send visibility, method_name
- send visibility, method_name_without_newrelic
+ send(visibility, method_name)
+ send(visibility, method_name_without_newrelic)
end
end
end
# Wrap a call to a datastore and record New Relic Datastore metrics. This