Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request-profiler 0.0.4 failing with ruby-prof 1.0.0 #7

Open
kikonen opened this issue Oct 10, 2019 · 3 comments
Open

request-profiler 0.0.4 failing with ruby-prof 1.0.0 #7

kikonen opened this issue Oct 10, 2019 · 3 comments

Comments

@kikonen
Copy link

kikonen commented Oct 10, 2019

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
...
@kikonen
Copy link
Author

kikonen commented Oct 10, 2019

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

@kikonen
Copy link
Author

kikonen commented Jun 20, 2022

It looks like same workaround is still relevant

@cdimitroulas
Copy link

cdimitroulas commented Dec 19, 2022

Thanks, this workaround worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants