Commit 4cf6be2b authored by Pawel Chojnacki's avatar Pawel Chojnacki

Differentiatie between class and instance methods

parent 815b8db1
......@@ -123,14 +123,16 @@ module Gitlab
if type == :instance
target = mod
label = "#{mod.name}##{name}"
method_name = "##{name}"
method = mod.instance_method(name)
else
target = mod.singleton_class
label = "#{mod.name}.#{name}"
method_name = ".#{name}"
method = mod.method(name)
end
label = "#{mod.name}#{method_name}"
unless instrumented?(target)
target.instance_variable_set(PROXY_IVAR, Module.new)
end
......@@ -153,7 +155,7 @@ module Gitlab
proxy_module.class_eval <<-EOF, __FILE__, __LINE__ + 1
def #{name}(#{args_signature})
if trans = Gitlab::Metrics::Instrumentation.transaction
trans.method_call_for(#{label.to_sym.inspect}, #{mod.name.to_sym.inspect}, #{name.to_sym.inspect})
trans.method_call_for(#{label.to_sym.inspect}, #{mod.name.inspect}, "#{method_name}")
.measure { super }
else
super
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment