class RubyProf::FlatPrinter

  1. lib/ruby-prof/flat_printer.rb
Parent: RubyProf

Generates flat profile reports as text. To use the flat printer:

result = RubyProf.profile do
  [code to profile]
end
printer = RubyProf::FlatPrinter.new(result)
printer.print(STDOUT, {})

Methods

Public Instance

  1. print

Public Instance methods

print (output = STDOUT, options = {})

Print a flat profile report to the provided output.

output - Any IO object, including STDOUT or a file. The default value is STDOUT.

options - Hash of print options. See setup_options for more information.

[show source]
# File lib/ruby-prof/flat_printer.rb, line 22
def print(output = STDOUT, options = {})
  @output = output
  # Now sort methods by largest self time by default,
  # not total time like in other printouts
  options[:sort_method] ||= :self_time
  setup_options(options)
  print_threads
end