Skip to content

Instantly share code, notes, and snippets.

@danlucraft
Created March 16, 2011 11:37
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save danlucraft/872355 to your computer and use it in GitHub Desktop.
Save danlucraft/872355 to your computer and use it in GitHub Desktop.
require 'jruby/profiler'
profile_data = JRuby::Profiler.profile do
# code to be profiled....
end
my_output_stream = java.io.ByteArrayOutputStream.new
print_stream = java.io.PrintStream.new(my_output_stream)
profile_printer = JRuby::Profiler::GraphProfilePrinter.new(profile_data)
profile_printer.printProfile(print_stream)
result = my_output_stream.toString
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment