Class: RubyProf::FlatPrinter

Inherits:
AbstractPrinter show all
Defined in:
lib/ruby-prof/flat_printer.rb

Overview

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, 0)

Direct Known Subclasses

FlatPrinterWithLineNumbers

Instance Method Summary collapse

Methods inherited from AbstractPrinter

#initialize, #method_name, #min_percent, #print_file, #setup_options

Constructor Details

This class inherits a constructor from RubyProf::AbstractPrinter

Instance Method Details

Print a flat profile report to the provided output.

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

options - Hash of print options. See #setup_options

for more information.


23
24
25
26
27
# File 'lib/ruby-prof/flat_printer.rb', line 23

def print(output = STDOUT, options = {})
  @output = output
  setup_options(options)
  print_threads
end