lib/new_relic/agent/instrumentation/memcache/helper.rb in newrelic_rpm-8.9.0 vs lib/new_relic/agent/instrumentation/memcache/helper.rb in newrelic_rpm-8.10.0
- old
+ new
@@ -4,12 +4,12 @@
# frozen_string_literal: true
module NewRelic::Agent::Instrumentation
module Memcache
module Helper
- DATASTORE_INSTANCES_SUPPORTED_VERSION = Gem::Version.new '2.6.4'
- BINARY_PROTOCOL_SUPPORTED_VERSION = Gem::Version.new '3.0.2'
+ DATASTORE_INSTANCES_SUPPORTED_VERSION = Gem::Version.new('2.6.4')
+ BINARY_PROTOCOL_SUPPORTED_VERSION = Gem::Version.new('3.0.2')
def supports_datastore_instances?
DATASTORE_INSTANCES_SUPPORTED_VERSION <= Gem::Version.new(::Dalli::VERSION)
end
@@ -36,23 +36,23 @@
end
end
def instrument_methods(client_class, requested_methods = METHODS)
supported_methods_for(client_class, requested_methods).each do |method_name|
- visibility = NewRelic::Helper.instance_method_visibility client_class, method_name
+ visibility = NewRelic::Helper.instance_method_visibility(client_class, method_name)
method_name_without = :"#{method_name}_without_newrelic_trace"
client_class.class_eval do
include NewRelic::Agent::Instrumentation::Memcache::Tracer
- alias_method method_name_without, method_name
+ alias_method(method_name_without, method_name)
- define_method method_name do |*args, &block|
- with_newrelic_tracing(method_name, *args) { __send__ method_name_without, *args, &block }
+ define_method(method_name) do |*args, &block|
+ with_newrelic_tracing(method_name, *args) { __send__(method_name_without, *args, &block) }
end
- __send__ visibility, method_name
- __send__ visibility, method_name_without
+ __send__(visibility, method_name)
+ __send__(visibility, method_name_without)
end
end
end
end
end