request_profiler
request_profiler copied to clipboard
request-profiler 0.0.4 failing with ruby-prof 1.0.0
request-profiler 0.0.4 ruby-prof 1.0.0
following error occurs
uninitialized constant RubyProf::FlatPrinterWithLineNumbers
at
module Rack
class RequestProfiler
...
def format(printer)
case printer
when ::RubyProf::FlatPrinter
'txt'
when ::RubyProf::FlatPrinterWithLineNumbers
'txt'
when ::RubyProf::GraphPrinter
'txt'
when ::RubyProf::GraphHtmlPrinter
'html'
when ::RubyProf::DotPrinter
'dot'
when ::RubyProf::CallTreePrinter
"out.#{Process.pid}"
when ::RubyProf::CallStackPrinter
'html'
else
'txt'
end
end
...
my workaround
config/initializers/request_profiler.rb
if defined?(Rack::RequestProfiler)
module Rack
class RequestProfiler
def format(printer)
case printer
when ::RubyProf::FlatPrinter
'txt'
# when ::RubyProf::FlatPrinterWithLineNumbers
# 'txt'
when ::RubyProf::GraphPrinter
'txt'
when ::RubyProf::GraphHtmlPrinter
'html'
when ::RubyProf::DotPrinter
'dot'
when ::RubyProf::CallTreePrinter
"out.#{Process.pid}"
when ::RubyProf::CallStackPrinter
'html'
else
'txt'
end
end
end
end
end
It looks like same workaround is still relevant
Thanks, this workaround worked for me