Commit f0897cb5 authored by Stan Hu's avatar Stan Hu Committed by Sean McGivern

Fix command-line profiling with ruby-prof

ruby-prof v1.0 changed the interface of `RubyProf::AbstractPrinter` from
`method_name` to `method_location`.

This fixes an unknown method error when using
`Gitlab::Profiler.print_by_total_time` as documented in
https://docs.gitlab.com/ee/development/profiling.html.
parent d3f746bd
......@@ -24,7 +24,7 @@ module Gitlab
sum += method.self_time
@output << "%6.2f %9.3f %9.3f %9.3f %9.3f %8d %s%s\n" % [
@output << "%6.2f %9.3f %9.3f %9.3f %9.3f %8d %s%-30s %s\n" % [
method.self_time / total_time * 100, # %self
method.total_time, # total
method.self_time, # self
......@@ -32,7 +32,8 @@ module Gitlab
method.children_time, # children
method.called, # calls
method.recursive? ? "*" : " ", # cycle
method_name(method) # name
method.full_name, # method_name
method_location(method) # location
]
end
end
......
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