Class RubyProf::GraphHtmlPrinter
In: lib/ruby-prof/graph_html_printer.rb
Parent: AbstractPrinter

Generates graph profile reports as html. To use the graph html printer:

  result = RubyProf.profile do
    [code to profile]
  end

  printer = RubyProf::GraphHtmlPrinter.new(result)
  printer.print(STDOUT, :min_percent=>0)

The constructor takes two arguments. The first is a RubyProf::Result object generated from a profiling run. The second is the minimum %total (the methods total time divided by the overall total time) that a method must take for it to be printed out in the report. Use this parameter to eliminate methods that are not important to the overall profiling results.

Methods

Included Modules

ERB::Util

Constants

PERCENTAGE_WIDTH = 8
TIME_WIDTH = 10
CALL_WIDTH = 20

Public Class methods

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

Public Instance methods

These methods should be private but then ERB doesn‘t work. Turn off RDOC though

Creates a link to a method. Note that we do not create links to methods which are under the min_perecent specified by the user, since they will not be printed out.

Print a graph html 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.

unique options are:

  :filename    - specify a file to use that contains the ERB
                 template to use, instead of the built-in self.template

  :template    - specify an ERB template to use, instead of the
                 built-in self.template

[Validate]