equire 'jruby/profiler' module V1 class SomeController < PublicController def index profile_data = JRuby::Profiler.profile do [*50..1000].collect {|val| val = val + 10} end profile_printer = JRuby::Profiler::GraphProfilePrinter.new(profile_data) gff = File.open('graph.txt.' + Time.now.to_s.delete(' '), 'w') profile_printer.printProfile(gff) render text: profile_printer.printProfile(STDOUT) end end end