doc/RubyProf/GraphHtmlPrinter.html in ruby-prof-0.13.1 vs doc/RubyProf/GraphHtmlPrinter.html in ruby-prof-0.14.0

- old
+ new

@@ -1,182 +1,115 @@ <!DOCTYPE html> <html> <head> -<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> +<meta charset="UTF-8"> <title>class RubyProf::GraphHtmlPrinter - ruby-prof</title> -<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet"> +<link href="../fonts.css" rel="stylesheet"> +<link href="../rdoc.css" rel="stylesheet"> <script type="text/javascript"> var rdoc_rel_prefix = "../"; </script> -<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script> -<script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script> -<script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script> -<script type="text/javascript" charset="utf-8" src="../js/search.js"></script> -<script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script> -<script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script> +<script src="../js/jquery.js"></script> +<script src="../js/navigation.js"></script> +<script src="../js/search_index.js"></script> +<script src="../js/search.js"></script> +<script src="../js/searcher.js"></script> +<script src="../js/darkfish.js"></script> -<body id="top" class="class"> -<nav id="metadata"> - <nav id="home-section" class="section"> - <h3 class="section-header"> - <a href="../index.html">Home</a> +<body id="top" role="document" class="class"> +<nav role="navigation"> + <div id="project-navigation"> + <div id="home-section" role="region" title="Quick navigation" class="nav-section"> + <h2> + <a href="../index.html" rel="home">Home</a> + </h2> + + <div id="table-of-contents-navigation"> + <a href="../table_of_contents.html#pages">Pages</a> <a href="../table_of_contents.html#classes">Classes</a> <a href="../table_of_contents.html#methods">Methods</a> - </h3> -</nav> + </div> +</div> - - <nav id="search-section" class="section project-section" class="initially-hidden"> + <div id="search-section" role="search" class="project-section initially-hidden"> <form action="#" method="get" accept-charset="utf-8"> - <h3 class="section-header"> - <input type="text" name="search" placeholder="Search" id="search-field" + <div id="search-field-wrapper"> + <input id="search-field" role="combobox" aria-label="Search" + aria-autocomplete="list" aria-controls="search-results" + type="text" name="search" placeholder="Search" spellcheck="false" title="Type to search, Up and Down to navigate, Enter to load"> - </h3> + </div> + + <ul id="search-results" aria-label="Search Results" + aria-busy="false" aria-expanded="false" + aria-atomic="false" class="initially-hidden"></ul> </form> +</div> - <ul id="search-results" class="initially-hidden"></ul> -</nav> - - - <div id="file-metadata"> - <nav id="file-list-section" class="section"> - <h3 class="section-header">Defined In</h3> - <ul> - <li>lib/ruby-prof/printers/graph_html_printer.rb - </ul> -</nav> - - </div> + + <div id="class-metadata"> - <nav id="parent-class-section" class="section"> - <h3 class="section-header">Parent</h3> + <div id="parent-class-section" class="nav-section"> + <h3>Parent</h3> + <p class="link"><a href="AbstractPrinter.html">RubyProf::AbstractPrinter</a> -</nav> +</div> - <!-- Included Modules --> -<nav id="includes-section" class="section"> - <h3 class="section-header">Included Modules</h3> + <div id="includes-section" class="nav-section"> + <h3>Included Modules</h3> <ul class="link-list"> <li><span class="include">ERB::Util</span> </ul> -</nav> +</div> + <!-- Method Quickref --> -<nav id="method-list-section" class="section"> - <h3 class="section-header">Methods</h3> +<div id="method-list-section" class="nav-section"> + <h3>Methods</h3> - <ul class="link-list"> + <ul class="link-list" role="directory"> - <li><a href="#method-i-create_link">#create_link</a> + <li ><a href="#method-i-create_link">#create_link</a> - <li><a href="#method-i-file_link">#file_link</a> + <li ><a href="#method-i-file_link">#file_link</a> - <li><a href="#method-i-method_href">#method_href</a> + <li ><a href="#method-i-method_href">#method_href</a> - <li><a href="#method-i-print">#print</a> + <li ><a href="#method-i-print">#print</a> - <li><a href="#method-i-setup_options">#setup_options</a> + <li class="calls-super" ><a href="#method-i-setup_options">#setup_options</a> - <li><a href="#method-i-template">#template</a> + <li ><a href="#method-i-template">#template</a> </ul> -</nav> +</div> </div> - - <div id="project-metadata"> - <nav id="fileindex-section" class="section project-section"> - <h3 class="section-header">Pages</h3> - - <ul> - - <li class="file"><a href="../LICENSE.html">LICENSE</a> - - <li class="file"><a href="../README_rdoc.html">README</a> - - <li class="file"><a href="../examples/flat_txt.html">flat</a> - - <li class="file"><a href="../examples/graph_txt.html">graph</a> - - </ul> </nav> - <nav id="classindex-section" class="section project-section"> - <h3 class="section-header">Class and Module Index</h3> +<main role="main" aria-labelledby="class-RubyProf::GraphHtmlPrinter"> + <h1 id="class-RubyProf::GraphHtmlPrinter" class="class"> + class RubyProf::GraphHtmlPrinter + </h1> - <ul class="link-list"> - - <li><a href="../RubyProf.html">RubyProf</a> - - <li><a href="../RubyProf/AbstractPrinter.html">RubyProf::AbstractPrinter</a> - - <li><a href="../RubyProf/AggregateCallInfo.html">RubyProf::AggregateCallInfo</a> - - <li><a href="../RubyProf/CallInfo.html">RubyProf::CallInfo</a> - - <li><a href="../RubyProf/CallInfoPrinter.html">RubyProf::CallInfoPrinter</a> - - <li><a href="../RubyProf/CallInfoVisitor.html">RubyProf::CallInfoVisitor</a> - - <li><a href="../RubyProf/CallStackPrinter.html">RubyProf::CallStackPrinter</a> - - <li><a href="../RubyProf/CallTreePrinter.html">RubyProf::CallTreePrinter</a> - - <li><a href="../RubyProf/Cmd.html">RubyProf::Cmd</a> - - <li><a href="../RubyProf/DotPrinter.html">RubyProf::DotPrinter</a> - - <li><a href="../RubyProf/FlatPrinter.html">RubyProf::FlatPrinter</a> - - <li><a href="../RubyProf/FlatPrinterWithLineNumbers.html">RubyProf::FlatPrinterWithLineNumbers</a> - - <li><a href="../RubyProf/GraphHtmlPrinter.html">RubyProf::GraphHtmlPrinter</a> - - <li><a href="../RubyProf/GraphPrinter.html">RubyProf::GraphPrinter</a> - - <li><a href="../RubyProf/MethodInfo.html">RubyProf::MethodInfo</a> - - <li><a href="../RubyProf/MultiPrinter.html">RubyProf::MultiPrinter</a> - - <li><a href="../RubyProf/Profile.html">RubyProf::Profile</a> - - <li><a href="../RubyProf/ProfileTask.html">RubyProf::ProfileTask</a> - - <li><a href="../RubyProf/Test.html">RubyProf::Test</a> - - <li><a href="../RubyProf/Thread.html">RubyProf::Thread</a> - - <li><a href="../Rack.html">Rack</a> - - <li><a href="../Rack/RubyProf.html">Rack::RubyProf</a> - - </ul> -</nav> - - </div> -</nav> - -<div id="documentation"> - <h1 class="class">class RubyProf::GraphHtmlPrinter</h1> - - <div id="description" class="description"> + <section class="description"> <p>Generates <a href="../files/examples/graph_html.html">graph</a> profile reports as html. To use the graph html printer:</p> <pre class="ruby"><span class="ruby-identifier">result</span> = <span class="ruby-constant">RubyProf</span>.<span class="ruby-identifier">profile</span> <span class="ruby-keyword">do</span> @@ -193,206 +126,228 @@ template to use, instead of the built-in self.template :template - specify an ERB template to use, instead of the built-in self.template</pre> - </div><!-- description --> + </section> <section id="5Buntitled-5D" class="documentation-section"> - <!-- Constants --> - <section id="constants-list" class="section"> - <h3 class="section-header">Constants</h3> + <section class="constants-list"> + <header> + <h3>Constants</h3> + </header> <dl> <dt id="CALL_WIDTH">CALL_WIDTH - <dd class="description"> + <dd> <dt id="PERCENTAGE_WIDTH">PERCENTAGE_WIDTH - <dd class="description"> + <dd> <dt id="TIME_WIDTH">TIME_WIDTH - <dd class="description"> + <dd> </dl> </section> - <!-- Methods --> - <section id="public-instance-5Buntitled-5D-method-details" class="method-section section"> - <h3 class="section-header">Public Instance Methods</h3> + <section id="public-instance-5Buntitled-5D-method-details" class="method-section"> + <header> + <h3>Public Instance Methods</h3> + </header> <div id="method-i-create_link" class="method-detail "> <div class="method-heading"> <span class="method-name">create_link</span><span class="method-args">(thread, overall_time, method)</span> + <span class="method-click-advice">click to toggle source</span> + </div> <div class="method-description"> <p>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.</p> + <div class="method-source-code" id="create_link-source"> <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 49</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">create_link</span>(<span class="ruby-identifier">thread</span>, <span class="ruby-identifier">overall_time</span>, <span class="ruby-identifier">method</span>) - <span class="ruby-identifier">total_percent</span> = (<span class="ruby-identifier">method</span>.<span class="ruby-identifier">total_time</span><span class="ruby-operator">/</span><span class="ruby-identifier">overall_time</span>) * <span class="ruby-value">100</span> + <span class="ruby-identifier">total_percent</span> = (<span class="ruby-identifier">method</span>.<span class="ruby-identifier">total_time</span><span class="ruby-operator">/</span><span class="ruby-identifier">overall_time</span>) <span class="ruby-operator">*</span> <span class="ruby-value">100</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">total_percent</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">min_percent</span> <span class="ruby-comment"># Just return name</span> <span class="ruby-identifier">h</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">full_name</span> <span class="ruby-keyword">else</span> <span class="ruby-identifier">href</span> = <span class="ruby-string">&#39;#&#39;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">method_href</span>(<span class="ruby-identifier">thread</span>, <span class="ruby-identifier">method</span>) <span class="ruby-node">&quot;&lt;a href=\&quot;#{href}\&quot;&gt;#{h method.full_name}&lt;/a&gt;&quot;</span> <span class="ruby-keyword">end</span> <span class="ruby-keyword">end</span></pre> - </div><!-- create_link-source --> + </div> </div> - </div><!-- create_link-method --> + </div> <div id="method-i-file_link" class="method-detail "> <div class="method-heading"> <span class="method-name">file_link</span><span class="method-args">(path, linenum)</span> + <span class="method-click-advice">click to toggle source</span> + </div> <div class="method-description"> + <div class="method-source-code" id="file_link-source"> <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 64</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">file_link</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">linenum</span>) <span class="ruby-identifier">srcfile</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">path</span>) - <span class="ruby-keyword">if</span> <span class="ruby-identifier">srcfile</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">%r\/ruby_runtime$/</span> + <span class="ruby-keyword">if</span> <span class="ruby-identifier">srcfile</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/\/ruby_runtime$/</span> <span class="ruby-string">&quot;&quot;</span> <span class="ruby-keyword">else</span> - <span class="ruby-keyword">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">%rdarwin/</span> + <span class="ruby-keyword">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/darwin/</span> <span class="ruby-node">&quot;&lt;a href=\&quot;txmt://open?url=file://#{h srcfile}&amp;line=#{linenum}\&quot; title=\&quot;#{h srcfile}:#{linenum}\&quot;&gt;#{linenum}&lt;/a&gt;&quot;</span> <span class="ruby-keyword">else</span> <span class="ruby-node">&quot;&lt;a href=\&quot;file://#{h srcfile}##{linenum}\&quot; title=\&quot;#{h srcfile}:#{linenum}\&quot;&gt;#{linenum}&lt;/a&gt;&quot;</span> <span class="ruby-keyword">end</span> <span class="ruby-keyword">end</span> <span class="ruby-keyword">end</span></pre> - </div><!-- file_link-source --> + </div> </div> - </div><!-- file_link-method --> + </div> <div id="method-i-method_href" class="method-detail "> <div class="method-heading"> <span class="method-name">method_href</span><span class="method-args">(thread, method)</span> + <span class="method-click-advice">click to toggle source</span> + </div> <div class="method-description"> + <div class="method-source-code" id="method_href-source"> <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 60</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">method_href</span>(<span class="ruby-identifier">thread</span>, <span class="ruby-identifier">method</span>) - <span class="ruby-identifier">h</span>(<span class="ruby-identifier">method</span>.<span class="ruby-identifier">full_name</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">%r[&gt;&lt;#\.\?=:]/</span>,<span class="ruby-string">&quot;_&quot;</span>) <span class="ruby-operator">+</span> <span class="ruby-string">&quot;_&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">fiber_id</span>.<span class="ruby-identifier">to_s</span>) + <span class="ruby-identifier">h</span>(<span class="ruby-identifier">method</span>.<span class="ruby-identifier">full_name</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/[&gt;&lt;#\.\?=:]/</span>,<span class="ruby-string">&quot;_&quot;</span>) <span class="ruby-operator">+</span> <span class="ruby-string">&quot;_&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">fiber_id</span>.<span class="ruby-identifier">to_s</span>) <span class="ruby-keyword">end</span></pre> - </div><!-- method_href-source --> + </div> </div> - </div><!-- method_href-method --> + </div> <div id="method-i-print" class="method-detail "> <div class="method-heading"> <span class="method-name">print</span><span class="method-args">(output = STDOUT, options = {})</span> + <span class="method-click-advice">click to toggle source</span> + </div> <div class="method-description"> + <div class="method-source-code" id="print-source"> <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 39</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">print</span>(<span class="ruby-identifier">output</span> = <span class="ruby-constant">STDOUT</span>, <span class="ruby-identifier">options</span> = {}) <span class="ruby-ivar">@output</span> = <span class="ruby-identifier">output</span> <span class="ruby-identifier">setup_options</span>(<span class="ruby-identifier">options</span>) <span class="ruby-ivar">@output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@erb</span>.<span class="ruby-identifier">result</span>(<span class="ruby-identifier">binding</span>) <span class="ruby-keyword">end</span></pre> - </div><!-- print-source --> + </div> </div> - </div><!-- print-method --> + </div> <div id="method-i-setup_options" class="method-detail "> <div class="method-heading"> <span class="method-name">setup_options</span><span class="method-args">(options)</span> + <span class="method-click-advice">click to toggle source</span> + </div> <div class="method-description"> + + <div class="method-calls-super"> + Calls superclass method + <a href="AbstractPrinter.html#method-i-setup_options">RubyProf::AbstractPrinter#setup_options</a> + </div> + <div class="method-source-code" id="setup_options-source"> <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 30</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">setup_options</span>(<span class="ruby-identifier">options</span>) @@ -401,33 +356,36 @@ <span class="ruby-identifier">filename</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:filename</span>] <span class="ruby-identifier">template</span> = <span class="ruby-identifier">filename</span> <span class="ruby-operator">?</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">filename</span>).<span class="ruby-identifier">untaint</span> <span class="ruby-operator">:</span> (<span class="ruby-identifier">options</span>[<span class="ruby-value">:template</span>] <span class="ruby-operator">||</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">template</span>) <span class="ruby-ivar">@erb</span> = <span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">template</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>) <span class="ruby-ivar">@erb</span>.<span class="ruby-identifier">filename</span> = <span class="ruby-identifier">filename</span> <span class="ruby-keyword">end</span></pre> - </div><!-- setup_options-source --> + </div> </div> - </div><!-- setup_options-method --> + </div> <div id="method-i-template" class="method-detail "> <div class="method-heading"> <span class="method-name">template</span><span class="method-args">()</span> + <span class="method-click-advice">click to toggle source</span> + </div> <div class="method-description"> + <div class="method-source-code" id="template-source"> <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 77</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">template</span> @@ -491,35 +449,27 @@ &lt;h1&gt;Profile Report&lt;/h1&gt; &lt;!-- Threads Table --&gt; &lt;table&gt; &lt;tr&gt; &lt;th&gt;Thread ID&lt;/th&gt; - &lt;% if RUBY_VERSION &gt;= &quot;1.9&quot; %&gt; &lt;th&gt;Fiber ID&lt;/th&gt; - &lt;% end %&gt; &lt;th&gt;Total Time&lt;/th&gt; &lt;/tr&gt; &lt;% for thread in @result.threads %&gt; &lt;tr&gt; - &lt;% if RUBY_VERSION &gt;= &quot;1.9&quot; %&gt; &lt;td&gt;&lt;%= thread.id %&gt;&lt;/td&gt; - &lt;% end %&gt; &lt;td&gt;&lt;a href=&quot;#&lt;%= thread.fiber_id %&gt;&quot;&gt;&lt;%= thread.fiber_id %&gt;&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;%= thread.total_time %&gt;&lt;/td&gt; &lt;/tr&gt; &lt;% end %&gt; &lt;/table&gt; &lt;!-- Methods Tables --&gt; &lt;% for thread in @result.threads methods = thread.methods total_time = thread.total_time %&gt; - &lt;% if RUBY_VERSION &gt;= &quot;1.9&quot; %&gt; &lt;h2&gt;&lt;a name=&quot;&lt;%= thread.fiber_id %&gt;&quot;&gt;Thread &lt;%= thread.id %&gt;, Fiber: &lt;%= thread.fiber_id %&gt;&lt;/a&gt;&lt;/h2&gt; - &lt;% else %&gt; - &lt;h2&gt;&lt;a name=&quot;&lt;%= thread.fiber_id %&gt;&quot;&gt;Thread &lt;%= thread.fiber_id %&gt;&lt;/a&gt;&lt;/h2&gt; - &lt;% end %&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;&lt;%= sprintf(&quot;%#{PERCENTAGE_WIDTH}s&quot;, &quot;%Total&quot;) %&gt;&lt;/th&gt; &lt;th&gt;&lt;%= sprintf(&quot;%#{PERCENTAGE_WIDTH}s&quot;, &quot;%Self&quot;) %&gt;&lt;/th&gt; @@ -603,28 +553,27 @@ &lt;/table&gt; &lt;% end %&gt; &lt;/body&gt; &lt;/html&gt;&#39;</span> <span class="ruby-keyword">end</span></pre> - </div><!-- template-source --> + </div> </div> - </div><!-- template-method --> + </div> - </section><!-- public-instance-method-details --> + </section> - </section><!-- 5Buntitled-5D --> + </section> +</main> -</div><!-- documentation --> - -<footer id="validator-badges"> - <p><a href="http://validator.w3.org/check/referer">[Validate]</a> - <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1. - <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3. +<footer id="validator-badges" role="contentinfo"> + <p><a href="http://validator.w3.org/check/referer">Validate</a> + <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0. + <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>. </footer>