lib/new_relic/agent/instrumentation/memcache/prepend.rb in newrelic_rpm-8.9.0 vs lib/new_relic/agent/instrumentation/memcache/prepend.rb in newrelic_rpm-8.10.0
- old
+ new
@@ -8,11 +8,11 @@
module Prepend
extend Helper
module_function
- def client_prepender client_class
+ def client_prepender(client_class)
Module.new do
extend Helper
include NewRelic::Agent::Instrumentation::Memcache::Tracer
supported_methods_for(client_class, client_methods).each do |method_name|
@@ -22,32 +22,32 @@
end
end
end
def dalli_cas_prependers
- yield ::Dalli::Client, dalli_client_prepender(dalli_cas_methods)
- yield ::Dalli::Client, dalli_get_multi_prepender(:get_multi_cas)
+ yield(::Dalli::Client, dalli_client_prepender(dalli_cas_methods))
+ yield(::Dalli::Client, dalli_get_multi_prepender(:get_multi_cas))
end
def dalli_prependers
if supports_datastore_instances?
- yield ::Dalli::Client, dalli_client_prepender(dalli_methods)
- yield ::Dalli::Client, dalli_get_multi_prepender(:get_multi)
+ yield(::Dalli::Client, dalli_client_prepender(dalli_methods))
+ yield(::Dalli::Client, dalli_get_multi_prepender(:get_multi))
if supports_binary_protocol?
- yield ::Dalli::Protocol::Binary, dalli_server_prepender
+ yield(::Dalli::Protocol::Binary, dalli_server_prepender)
else
- yield ::Dalli::Server, dalli_server_prepender
+ yield(::Dalli::Server, dalli_server_prepender)
end
- yield ::Dalli::Ring, dalli_ring_prepender
+ yield(::Dalli::Ring, dalli_ring_prepender)
else
- yield ::Dalli::Client, dalli_client_prepender(client_methods)
+ yield(::Dalli::Client, dalli_client_prepender(client_methods))
end
end
- def dalli_client_prepender supported_methods
+ def dalli_client_prepender(supported_methods)
Module.new do
extend Helper
include NewRelic::Agent::Instrumentation::Memcache::Tracer
supported_methods.each do |method_name|
@@ -56,11 +56,11 @@
end
end
end
end
- def dalli_get_multi_prepender method_name
+ def dalli_get_multi_prepender(method_name)
Module.new do
extend Helper
include NewRelic::Agent::Instrumentation::Memcache::Tracer
define_method method_name do |*args, &block|
@@ -72,11 +72,11 @@
def dalli_ring_prepender
Module.new do
extend Helper
include NewRelic::Agent::Instrumentation::Memcache::Tracer
- def server_for_key key
+ def server_for_key(key)
server_for_key_with_newrelic_tracing { super }
end
end
end
@@ -85,14 +85,14 @@
extend Helper
include NewRelic::Agent::Instrumentation::Memcache::Tracer
# TODO: Dalli - 3.1.0 renamed send_multiget to piplined_get, but the method is otherwise the same
if Gem::Version.new(::Dalli::VERSION) >= Gem::Version.new('3.1.0')
- def pipelined_get keys
+ def pipelined_get(keys)
send_multiget_with_newrelic_tracing(keys) { super }
end
else
- def send_multiget keys
+ def send_multiget(keys)
send_multiget_with_newrelic_tracing(keys) { super }
end
end
end
end