doc/RubyProf/CallInfo.html in ruby-prof-0.16.2 vs doc/RubyProf/CallInfo.html in ruby-prof-0.17.0
- old
+ new
@@ -6,10 +6,11 @@
<title>class RubyProf::CallInfo - ruby-prof</title>
<script type="text/javascript">
var rdoc_rel_prefix = "../";
+ var index_rel_prefix = "../";
</script>
<script src="../js/jquery.js"></script>
<script src="../js/darkfish.js"></script>
@@ -76,12 +77,10 @@
<li ><a href="#method-i-children_time">#children_time</a>
<li ><a href="#method-i-descendent_of">#descendent_of</a>
- <li ><a href="#method-i-detect_recursion">#detect_recursion</a>
-
<li ><a href="#method-i-eliminate-21">#eliminate!</a>
<li ><a href="#method-i-find_call">#find_call</a>
<li class="calls-super" ><a href="#method-i-inspect">#inspect</a>
@@ -118,37 +117,12 @@
- <section class="attribute-method-details" class="method-section">
- <header>
- <h3>Attributes</h3>
- </header>
-
- <div id="attribute-i-recursive" class="method-detail">
- <div class="method-heading attribute-method-heading">
- <span class="method-name">recursive</span><span
- class="attribute-access-type">[R]</span>
- </div>
-
- <div class="method-description">
-
- <p>part of this class is defined in C code. it provides the following
-attributes pertaining to tree structure: depth: tree level (0 == root)
-parent: parent call info (can be nil) children: array of call info
-children (can be empty) target: method info (containing an array of
-call infos)</p>
-
- </div>
- </div>
-
- </section>
-
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
<header>
<h3>Public Class Methods</h3>
</header>
@@ -170,11 +144,11 @@
<div class="method-source-code" id="roots_of-source">
- <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 59</span>
+ <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 48</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">roots_of</span>(<span class="ruby-identifier">call_infos</span>)
<span class="ruby-identifier">roots</span> = []
<span class="ruby-identifier">sorted</span> = <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">sort_by</span>(<span class="ruby-operator">&</span><span class="ruby-value">:depth</span>).<span class="ruby-identifier">reverse</span>
<span class="ruby-keyword">while</span> <span class="ruby-identifier">call_info</span> = <span class="ruby-identifier">sorted</span>.<span class="ruby-identifier">shift</span>
<span class="ruby-identifier">roots</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">call_info</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">sorted</span>.<span class="ruby-identifier">any?</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">descendent_of</span>(<span class="ruby-identifier">p</span>)}
@@ -216,11 +190,11 @@
<div class="method-source-code" id="call_sequence-source">
- <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 41</span>
+ <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 30</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">call_sequence</span>
<span class="ruby-ivar">@call_sequence</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
<span class="ruby-identifier">stack</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">method</span><span class="ruby-operator">|</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">full_name</span>}.<span class="ruby-identifier">join</span>(<span class="ruby-string">'->'</span>)
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
@@ -245,17 +219,21 @@
</div>
<div class="method-description">
+ <p>part of this class is defined in C code. it provides the following
+attributes pertaining to tree structure: depth: tree level (0 == root)
+parent: parent call info (can be nil) children: array of call info
+children (can be empty) target: method info (containing an array of
+call infos)</p>
-
<div class="method-source-code" id="children_time-source">
- <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 22</span>
+ <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 11</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">children_time</span>
<span class="ruby-identifier">children</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sum</span>, <span class="ruby-identifier">call_info</span><span class="ruby-operator">|</span>
<span class="ruby-identifier">sum</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">total_time</span>
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
@@ -286,11 +264,11 @@
<div class="method-source-code" id="descendent_of-source">
- <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 51</span>
+ <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 40</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">descendent_of</span>(<span class="ruby-identifier">other</span>)
<span class="ruby-identifier">p</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">parent</span>
<span class="ruby-keyword">while</span> <span class="ruby-identifier">p</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">p</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">other</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">depth</span> <span class="ruby-operator">></span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">depth</span>
<span class="ruby-identifier">p</span> = <span class="ruby-identifier">p</span>.<span class="ruby-identifier">parent</span>
<span class="ruby-keyword">end</span>
@@ -304,48 +282,10 @@
</div>
- <div id="method-i-detect_recursion" class="method-detail ">
-
- <div class="method-heading">
- <span class="method-name">detect_recursion</span><span
- class="method-args">(visited_methods = Hash.new(0))</span>
-
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
-
- <div class="method-description">
-
-
-
-
-
-
- <div class="method-source-code" id="detect_recursion-source">
- <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 13</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">detect_recursion</span>(<span class="ruby-identifier">visited_methods</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>))
- <span class="ruby-ivar">@recursive</span> = (<span class="ruby-identifier">visited_methods</span>[<span class="ruby-identifier">target</span>] <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>) <span class="ruby-operator">></span> <span class="ruby-value">1</span>
- <span class="ruby-identifier">children</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">child</span><span class="ruby-operator">|</span>
- <span class="ruby-identifier">child</span>.<span class="ruby-identifier">detect_recursion</span>(<span class="ruby-identifier">visited_methods</span>)
- <span class="ruby-keyword">end</span>
- <span class="ruby-identifier">visited_methods</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">target</span>) <span class="ruby-keyword">if</span> (<span class="ruby-identifier">visited_methods</span>[<span class="ruby-identifier">target</span>] <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>) <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
- <span class="ruby-keyword">return</span> <span class="ruby-ivar">@recursive</span>
-<span class="ruby-keyword">end</span></pre>
- </div>
-
- </div>
-
-
-
-
- </div>
-
-
<div id="method-i-eliminate-21" class="method-detail ">
<div class="method-heading">
<span class="method-name">eliminate!</span><span
class="method-args">()</span>
@@ -363,11 +303,11 @@
<div class="method-source-code" id="eliminate-21-source">
- <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 79</span>
+ <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 68</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">eliminate!</span>
<span class="ruby-comment"># puts "eliminating #{self}"</span>
<span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">parent</span>
<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">add_self_time</span>(<span class="ruby-keyword">self</span>)
<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">add_wait_time</span>(<span class="ruby-keyword">self</span>)
@@ -412,11 +352,11 @@
<div class="method-source-code" id="find_call-source">
- <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 99</span>
+ <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 88</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">find_call</span>(<span class="ruby-identifier">other</span>)
<span class="ruby-identifier">matching</span> = <span class="ruby-identifier">children</span>.<span class="ruby-identifier">select</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">kid</span><span class="ruby-operator">|</span> <span class="ruby-identifier">kid</span>.<span class="ruby-identifier">target</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">target</span> }
<span class="ruby-identifier">raise</span> <span class="ruby-string">"inconsistent call tree"</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">matching</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator"><=</span> <span class="ruby-value">1</span>
<span class="ruby-identifier">matching</span>.<span class="ruby-identifier">first</span>
<span class="ruby-keyword">end</span></pre>
@@ -452,11 +392,11 @@
</div>
<div class="method-source-code" id="inspect-source">
- <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 72</span>
+ <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 61</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">inspect</span>
<span class="ruby-keyword">super</span> <span class="ruby-operator">+</span> <span class="ruby-node">"(#{target.full_name}, d: #{depth}, c: #{called}, tt: #{total_time}, st: #{self_time}, ct: #{children_time})"</span>
<span class="ruby-keyword">end</span></pre>
</div>
@@ -486,11 +426,11 @@
<div class="method-source-code" id="merge_call_tree-source">
- <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 106</span>
+ <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 95</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">merge_call_tree</span>(<span class="ruby-identifier">other</span>)
<span class="ruby-comment"># $stderr.puts "merging #{self}\nand #{other}"</span>
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">called</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">called</span>
<span class="ruby-identifier">add_self_time</span>(<span class="ruby-identifier">other</span>)
<span class="ruby-identifier">add_wait_time</span>(<span class="ruby-identifier">other</span>)
@@ -534,11 +474,11 @@
<div class="method-source-code" id="root-3F-source">
- <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 47</span>
+ <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 36</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">root?</span>
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">nil?</span>
<span class="ruby-keyword">end</span></pre>
</div>
@@ -567,11 +507,11 @@
<div class="method-source-code" id="stack-source">
- <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 28</span>
+ <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 17</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">stack</span>
<span class="ruby-ivar">@stack</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
<span class="ruby-identifier">methods</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
<span class="ruby-identifier">call_info</span> = <span class="ruby-keyword">self</span>
@@ -609,11 +549,11 @@
<div class="method-source-code" id="to_s-source">
- <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 68</span>
+ <pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 57</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
<span class="ruby-node">"#{target.full_name} (c: #{called}, tt: #{total_time}, st: #{self_time}, ct: #{children_time})"</span>
<span class="ruby-keyword">end</span></pre>
</div>
@@ -631,9 +571,9 @@
</main>
<footer id="validator-badges" role="contentinfo">
<p><a href="http://validator.w3.org/check/referer">Validate</a>
- <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.2.
+ <p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.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>