Class: RubyProf::FlatPrinter

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

Overview

code to profile

end

printer = RubyProf::FlatPrinter.new(result) printer.print(STDOUT, 0)

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ FlatPrinter

Create a FlatPrinter. Result is a RubyProf::Result object generated from a profiling run.



15
16
17
# File 'lib/ruby-prof/flat_printer.rb', line 15

def initialize(result)
 @result = result
end

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.

min_percent - The minimum %self (the methods self time divided by the overall total time) that a method must take for it to be printed out in the report. Default value is 0.



28
29
30
31
32
# File 'lib/ruby-prof/flat_printer.rb', line 28

def print(output = STDOUT, min_percent = 0)
    @min_percent = min_percent
    @output = output
    print_threads
end