class RubyProf::AbstractPrinter

This is the base class for all Printers. It is never used directly.

Public Class Methods

new(result) click to toggle source

Create a new printer.

result should be the output generated from a profiling run

   # File lib/ruby-prof/printers/abstract_printer.rb
15 def initialize(result)
16   @result = result
17   @output = nil
18 end

Public Instance Methods

min_percent() click to toggle source

Returns the min_percent of total time a method must take to be included in a profiling report

   # File lib/ruby-prof/printers/abstract_printer.rb
21 def min_percent
22   @options[:min_percent] || 0
23 end
print(output = STDOUT, options = {}) click to toggle source

Prints a report to the provided output.

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

options - Hash of print options. Note that each printer can define its own set of options.

:min_percent - Number 0 to 100 that specifes 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.

:sort_method - Specifies method used for sorting method infos.
               Available values are :total_time, :self_time,
               :wait_time, :children_time
               Default value is :total_time
sort_method() click to toggle source

Returns how profile data should be sorted

   # File lib/ruby-prof/printers/abstract_printer.rb
31 def sort_method
32   @options[:sort_method]
33 end
time_format() click to toggle source

Returns the time format used to show when a profile was run

   # File lib/ruby-prof/printers/abstract_printer.rb
26 def time_format
27   '%A, %B %-d at %l:%M:%S %p (%Z)'
28 end