ruby-prof 0.12.2 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/README.rdoc +2 -2
  2. data/doc/LICENSE.html +1 -1
  3. data/doc/README_rdoc.html +2 -2
  4. data/doc/Rack.html +1 -1
  5. data/doc/Rack/RubyProf.html +2 -2
  6. data/doc/RubyProf.html +1 -1
  7. data/doc/RubyProf/AbstractPrinter.html +1 -1
  8. data/doc/RubyProf/AggregateCallInfo.html +1 -1
  9. data/doc/RubyProf/CallInfo.html +1 -1
  10. data/doc/RubyProf/CallInfoPrinter.html +1 -1
  11. data/doc/RubyProf/CallInfoVisitor.html +1 -1
  12. data/doc/RubyProf/CallStackPrinter.html +30 -27
  13. data/doc/RubyProf/CallTreePrinter.html +1 -1
  14. data/doc/RubyProf/Cmd.html +1 -1
  15. data/doc/RubyProf/DotPrinter.html +1 -1
  16. data/doc/RubyProf/FlatPrinter.html +1 -1
  17. data/doc/RubyProf/FlatPrinterWithLineNumbers.html +1 -1
  18. data/doc/RubyProf/GraphHtmlPrinter.html +14 -5
  19. data/doc/RubyProf/GraphPrinter.html +1 -1
  20. data/doc/RubyProf/MethodInfo.html +1 -1
  21. data/doc/RubyProf/MultiPrinter.html +1 -1
  22. data/doc/RubyProf/Profile.html +1 -1
  23. data/doc/RubyProf/ProfileTask.html +1 -1
  24. data/doc/RubyProf/Test.html +1 -1
  25. data/doc/RubyProf/Thread.html +1 -1
  26. data/doc/created.rid +11 -10
  27. data/doc/examples/flat_txt.html +1 -1
  28. data/doc/examples/graph_txt.html +1 -1
  29. data/doc/index.html +2 -2
  30. data/doc/js/darkfish.js +9 -7
  31. data/doc/table_of_contents.html +1 -1
  32. data/ext/ruby_prof/extconf.rb +2 -0
  33. data/ext/ruby_prof/rp_thread.c +24 -8
  34. data/ext/ruby_prof/rp_thread.h +5 -4
  35. data/ext/ruby_prof/ruby_prof.c +26 -10
  36. data/ext/ruby_prof/version.h +3 -3
  37. data/lib/ruby-prof/printers/call_info_printer.rb +2 -1
  38. data/lib/ruby-prof/printers/call_stack_printer.rb +7 -4
  39. data/lib/ruby-prof/printers/flat_printer.rb +1 -0
  40. data/lib/ruby-prof/printers/graph_html_printer.rb +13 -4
  41. data/lib/ruby-prof/printers/graph_printer.rb +2 -1
  42. data/lib/ruby-prof/rack.rb +1 -1
  43. data/ruby-prof.gemspec +1 -1
  44. data/test/fiber_test.rb +65 -0
  45. data/test/measure_process_time_test.rb +2 -2
  46. data/test/multi_printer_test.rb +4 -2
  47. data/test/printers_test.rb +2 -0
  48. data/test/stack_printer_test.rb +2 -2
  49. data/test/test_helper.rb +2 -0
  50. metadata +32 -25
data/README.rdoc CHANGED
@@ -276,7 +276,7 @@ Reports are created by printers. Supported printers include:
276
276
  To use a printer:
277
277
 
278
278
  ...
279
- result = RubyProf.end
279
+ result = RubyProf.stop
280
280
  printer = RubyProf::GraphPrinter.new(result)
281
281
  printer.print(STDOUT, :min_percent => 2)
282
282
 
@@ -429,4 +429,4 @@ See LICENSE for license information.
429
429
 
430
430
  Code is located at http://github.com/rdp/ruby-prof
431
431
 
432
- Google group/mailing list: http://groups.google.com/group/ruby-optimization
432
+ Google group/mailing list: http://groups.google.com/group/ruby-optimization
data/doc/LICENSE.html CHANGED
@@ -149,7 +149,7 @@ DAMAGE.</p>
149
149
 
150
150
  <footer id="validator-badges">
151
151
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
152
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
152
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
153
153
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
154
154
  </footer>
155
155
 
data/doc/README_rdoc.html CHANGED
@@ -445,7 +445,7 @@ other printers to create several reports in one profiling run</p>
445
445
  <p>To use a printer:</p>
446
446
 
447
447
  <pre class="ruby"><span class="ruby-operator">...</span>
448
- <span class="ruby-identifier">result</span> = <span class="ruby-constant">RubyProf</span>.<span class="ruby-identifier">end</span>
448
+ <span class="ruby-identifier">result</span> = <span class="ruby-constant">RubyProf</span>.<span class="ruby-identifier">stop</span>
449
449
  <span class="ruby-identifier">printer</span> = <span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">GraphPrinter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">result</span>)
450
450
  <span class="ruby-identifier">printer</span>.<span class="ruby-identifier">print</span>(<span class="ruby-constant">STDOUT</span>, :<span class="ruby-identifier">min_percent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">2</span>)
451
451
  </pre>
@@ -634,7 +634,7 @@ href="http://groups.google.com/group/ruby-optimization">groups.google.com/group/
634
634
 
635
635
  <footer id="validator-badges">
636
636
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
637
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
637
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
638
638
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
639
639
  </footer>
640
640
 
data/doc/Rack.html CHANGED
@@ -161,7 +161,7 @@
161
161
 
162
162
  <footer id="validator-badges">
163
163
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
164
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
164
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
165
165
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
166
166
  </footer>
167
167
 
@@ -205,7 +205,7 @@
205
205
  <span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">GraphHtmlPrinter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'graph.html'</span>,
206
206
  <span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">CallStackPrinter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'call_stack.html'</span>}
207
207
 
208
- <span class="ruby-ivar">@skip_paths</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:skip_paths</span>] <span class="ruby-operator">||</span> [<span class="ruby-regexp">%r{^/assets}</span>, <span class="ruby-regexp">%r{\.css$}</span>, <span class="ruby-regexp">%r{\.js}</span>, <span class="ruby-regexp">%r{\.png}</span>, <span class="ruby-regexp">%r{\.jpeg}</span>]
208
+ <span class="ruby-ivar">@skip_paths</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:skip_paths</span>] <span class="ruby-operator">||</span> [<span class="ruby-regexp">%r{^/assets}</span>, <span class="ruby-regexp">%r{\.css$}</span>, <span class="ruby-regexp">%r{\.js$}</span>, <span class="ruby-regexp">%r{\.png$}</span>, <span class="ruby-regexp">%r{\.jpeg$}</span>, <span class="ruby-regexp">%r{\.jpg$}</span>, <span class="ruby-regexp">%r{\.gif$}</span>]
209
209
  <span class="ruby-keyword">end</span></pre>
210
210
  </div><!-- new-source -->
211
211
 
@@ -313,7 +313,7 @@
313
313
 
314
314
  <footer id="validator-badges">
315
315
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
316
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
316
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
317
317
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
318
318
  </footer>
319
319
 
data/doc/RubyProf.html CHANGED
@@ -993,7 +993,7 @@ collection. This requires a patched Ruby interpreter.*/</p>
993
993
 
994
994
  <footer id="validator-badges">
995
995
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
996
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
996
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
997
997
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
998
998
  </footer>
999
999
 
@@ -574,7 +574,7 @@ options.</p>
574
574
 
575
575
  <footer id="validator-badges">
576
576
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
577
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
577
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
578
578
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
579
579
  </footer>
580
580
 
@@ -564,7 +564,7 @@
564
564
 
565
565
  <footer id="validator-badges">
566
566
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
567
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
567
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
568
568
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
569
569
  </footer>
570
570
 
@@ -506,7 +506,7 @@ merges children of other into children of self.</p>
506
506
 
507
507
  <footer id="validator-badges">
508
508
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
509
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
509
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
510
510
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
511
511
  </footer>
512
512
 
@@ -184,7 +184,7 @@ into into RubyProf’s internals.</p>
184
184
 
185
185
  <footer id="validator-badges">
186
186
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
187
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
187
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
188
188
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
189
189
  </footer>
190
190
 
@@ -326,7 +326,7 @@
326
326
 
327
327
  <footer id="validator-badges">
328
328
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
329
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
329
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
330
330
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
331
331
  </footer>
332
332
 
@@ -248,7 +248,7 @@
248
248
 
249
249
 
250
250
  <div class="method-source-code" id="application-source">
251
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 159</span>
251
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 162</span>
252
252
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">application</span>
253
253
  <span class="ruby-ivar">@options</span>[<span class="ruby-value">:application</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">$PROGRAM_NAME</span>
254
254
  <span class="ruby-keyword">end</span></pre>
@@ -278,7 +278,7 @@
278
278
 
279
279
 
280
280
  <div class="method-source-code" id="arguments-source">
281
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 163</span>
281
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 166</span>
282
282
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">arguments</span>
283
283
  <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">' '</span>)
284
284
  <span class="ruby-keyword">end</span></pre>
@@ -308,7 +308,7 @@
308
308
 
309
309
 
310
310
  <div class="method-source-code" id="color-source">
311
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 146</span>
311
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 149</span>
312
312
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">color</span>(<span class="ruby-identifier">p</span>)
313
313
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">i</span> = <span class="ruby-identifier">p</span>.<span class="ruby-identifier">to_i</span>
314
314
  <span class="ruby-keyword">when</span> <span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">5</span>
@@ -347,7 +347,7 @@
347
347
 
348
348
 
349
349
  <div class="method-source-code" id="copy_image_files-source">
350
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 179</span>
350
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 182</span>
351
351
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">copy_image_files</span>
352
352
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">File</span>)
353
353
  <span class="ruby-identifier">target_dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-ivar">@output</span>.<span class="ruby-identifier">path</span>)
@@ -385,7 +385,7 @@
385
385
 
386
386
 
387
387
  <div class="method-source-code" id="dump-source">
388
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 142</span>
388
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 145</span>
389
389
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">dump</span>(<span class="ruby-identifier">ci</span>)
390
390
  <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">printf</span> <span class="ruby-string">&quot;%s/%d t:%f s:%f w:%f \n&quot;</span>, <span class="ruby-identifier">ci</span>, <span class="ruby-identifier">ci</span>.<span class="ruby-identifier">object_id</span>, <span class="ruby-identifier">ci</span>.<span class="ruby-identifier">total_time</span>, <span class="ruby-identifier">ci</span>.<span class="ruby-identifier">self_time</span>, <span class="ruby-identifier">ci</span>.<span class="ruby-identifier">wait_time</span>
391
391
  <span class="ruby-keyword">end</span></pre>
@@ -415,7 +415,7 @@
415
415
 
416
416
 
417
417
  <div class="method-source-code" id="expansion-source">
418
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 175</span>
418
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 178</span>
419
419
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">expansion</span>
420
420
  <span class="ruby-ivar">@options</span>[<span class="ruby-value">:expansion</span>] <span class="ruby-operator">||</span> <span class="ruby-value">10.0</span>
421
421
  <span class="ruby-keyword">end</span></pre>
@@ -445,7 +445,7 @@
445
445
 
446
446
 
447
447
  <div class="method-source-code" id="graph_link-source">
448
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 123</span>
448
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 126</span>
449
449
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">graph_link</span>(<span class="ruby-identifier">call_info</span>)
450
450
  <span class="ruby-identifier">total_calls</span> = <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">target</span>.<span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">t</span>, <span class="ruby-identifier">ci</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">ci</span>.<span class="ruby-identifier">called</span>}
451
451
  <span class="ruby-identifier">href</span> = <span class="ruby-node">&quot;#{@graph_html}##{method_href(call_info.target)}&quot;</span>
@@ -478,7 +478,7 @@
478
478
 
479
479
 
480
480
  <div class="method-source-code" id="link-source">
481
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 109</span>
481
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 112</span>
482
482
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">link</span>(<span class="ruby-identifier">call_info</span>)
483
483
  <span class="ruby-identifier">method</span> = <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">target</span>
484
484
  <span class="ruby-identifier">file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">method</span>.<span class="ruby-identifier">source_file</span>)
@@ -518,7 +518,7 @@
518
518
 
519
519
 
520
520
  <div class="method-source-code" id="method_href-source">
521
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 130</span>
521
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 133</span>
522
522
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">method_href</span>(<span class="ruby-identifier">method</span>)
523
523
  <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-ivar">@current_thread_id</span>.<span class="ruby-identifier">to_s</span>)
524
524
  <span class="ruby-keyword">end</span></pre>
@@ -548,7 +548,7 @@
548
548
 
549
549
 
550
550
  <div class="method-source-code" id="name-source">
551
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 104</span>
551
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 107</span>
552
552
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">name</span>(<span class="ruby-identifier">call_info</span>)
553
553
  <span class="ruby-identifier">method</span> = <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">target</span>
554
554
  <span class="ruby-identifier">method</span>.<span class="ruby-identifier">full_name</span>
@@ -620,9 +620,12 @@
620
620
  <span class="ruby-keyword">end</span>
621
621
 
622
622
  <span class="ruby-ivar">@result</span>.<span class="ruby-identifier">threads</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">thread</span><span class="ruby-operator">|</span>
623
- <span class="ruby-ivar">@current_thread_id</span> = <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">id</span>
623
+ <span class="ruby-ivar">@current_thread_id</span> = <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">fiber_id</span>
624
624
  <span class="ruby-ivar">@overall_time</span> = <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">total_time</span>
625
- <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">print</span> <span class="ruby-node">&quot;&lt;div class=\&quot;thread\&quot;&gt;Thread: #{thread.id} (#{&quot;%4.2f%%&quot; % ((@overall_time/@overall_threads_time)*100)} ~ #{@overall_time})&lt;/div&gt;&quot;</span>
625
+ <span class="ruby-identifier">thread_info</span> = <span class="ruby-node">&quot;Thread: #{thread.id}&quot;</span>
626
+ <span class="ruby-identifier">thread_info</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;, Fiber: #{thread.fiber_id}&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">id</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">fiber_id</span>
627
+ <span class="ruby-identifier">thread_info</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; (#{&quot;%4.2f%%&quot; % ((@overall_time/@overall_threads_time)*100)} ~ #{@overall_time})&quot;</span>
628
+ <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">print</span> <span class="ruby-node">&quot;&lt;div class=\&quot;thread\&quot;&gt;#{thread_info}&lt;/div&gt;&quot;</span>
626
629
  <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">print</span> <span class="ruby-string">&quot;&lt;ul name=\&quot;thread\&quot;&gt;&quot;</span>
627
630
  <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">methods</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span>
628
631
  <span class="ruby-comment"># $stderr.print m.dump</span>
@@ -665,7 +668,7 @@
665
668
 
666
669
 
667
670
  <div class="method-source-code" id="print_commands-source">
668
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 737</span>
671
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 740</span>
669
672
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">print_commands</span>
670
673
  <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;&lt;div id=\&quot;commands\&quot;&gt;
671
674
  &lt;span style=\&quot;font-size: 11pt; font-weight: bold;\&quot;&gt;Threshold:&lt;/span&gt;
@@ -703,7 +706,7 @@
703
706
 
704
707
 
705
708
  <div class="method-source-code" id="print_css-source">
706
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 207</span>
709
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 210</span>
707
710
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">print_css</span>
708
711
  <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;&lt;style type=&quot;text/css&quot;&gt;
709
712
  &lt;!--
@@ -833,9 +836,9 @@ input { margin-left:10px; }
833
836
 
834
837
 
835
838
  <div class="method-source-code" id="print_footer-source">
836
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 203</span>
839
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 206</span>
837
840
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">print_footer</span>
838
- <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">'&lt;div id=&quot;sentinel&quot;&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;'</span>
841
+ <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">'&lt;div id=&quot;sentinel&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;'</span>
839
842
  <span class="ruby-keyword">end</span></pre>
840
843
  </div><!-- print_footer-source -->
841
844
 
@@ -863,14 +866,14 @@ input { margin-left:10px; }
863
866
 
864
867
 
865
868
  <div class="method-source-code" id="print_header-source">
866
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 191</span>
869
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 194</span>
867
870
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">print_header</span>
868
871
  <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;&lt;html&gt;&lt;head&gt;&quot;</span>
869
872
  <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">'&lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;'</span>
870
873
  <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;&lt;title&gt;#{h title}&lt;/title&gt;&quot;</span>
871
874
  <span class="ruby-identifier">print_css</span>
872
875
  <span class="ruby-identifier">print_java_script</span>
873
- <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">'&lt;/head&gt;&lt;body&gt;'</span>
876
+ <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">'&lt;/head&gt;&lt;body&gt;&lt;div style=&quot;display: inline-block;&quot;&gt;'</span>
874
877
  <span class="ruby-identifier">print_title_bar</span>
875
878
  <span class="ruby-identifier">print_commands</span>
876
879
  <span class="ruby-identifier">print_help</span>
@@ -901,7 +904,7 @@ input { margin-left:10px; }
901
904
 
902
905
 
903
906
  <div class="method-source-code" id="print_help-source">
904
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 750</span>
907
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 753</span>
905
908
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">print_help</span>
906
909
  <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;&lt;div style=&quot;display: none;&quot; id=&quot;help&quot;&gt;
907
910
  &lt;img src=&quot;empty.png&quot;&gt; Enter a decimal value &lt;i&gt;d&lt;/i&gt; into the threshold field and click &quot;Apply&quot;
@@ -944,7 +947,7 @@ to hide all nodes marked with time values lower than &lt;i&gt;d&lt;/i&gt;.&lt;br
944
947
 
945
948
 
946
949
  <div class="method-source-code" id="print_java_script-source">
947
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 312</span>
950
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 315</span>
948
951
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">print_java_script</span>
949
952
  <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;&lt;script type=&quot;text/javascript&quot;&gt;
950
953
  /*
@@ -1385,7 +1388,7 @@ window.onload=function(){
1385
1388
 
1386
1389
 
1387
1390
  <div class="method-source-code" id="print_stack-source">
1388
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 71</span>
1391
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 74</span>
1389
1392
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">print_stack</span>(<span class="ruby-identifier">call_info</span>, <span class="ruby-identifier">parent_time</span>)
1390
1393
  <span class="ruby-identifier">total_time</span> = <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">total_time</span>
1391
1394
  <span class="ruby-identifier">percent_parent</span> = (<span class="ruby-identifier">total_time</span><span class="ruby-operator">/</span><span class="ruby-identifier">parent_time</span>)*<span class="ruby-value">100</span>
@@ -1444,7 +1447,7 @@ window.onload=function(){
1444
1447
 
1445
1448
 
1446
1449
  <div class="method-source-code" id="print_title_bar-source">
1447
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 728</span>
1450
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 731</span>
1448
1451
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">print_title_bar</span>
1449
1452
  <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;&lt;div id=&quot;titlebar&quot;&gt;
1450
1453
  Call tree for application &lt;b&gt;#{h application} #{h arguments}&lt;/b&gt;&lt;br/&gt;
@@ -1478,7 +1481,7 @@ Generated on #{Time.now} with options #{h @options.inspect}&lt;br/&gt;
1478
1481
 
1479
1482
 
1480
1483
  <div class="method-source-code" id="sum-source">
1481
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 138</span>
1484
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 141</span>
1482
1485
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">sum</span>(<span class="ruby-identifier">a</span>)
1483
1486
  <span class="ruby-identifier">a</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0.0</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">s</span>,<span class="ruby-identifier">t</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span><span class="ruby-operator">+=</span><span class="ruby-identifier">t</span>}
1484
1487
  <span class="ruby-keyword">end</span></pre>
@@ -1508,7 +1511,7 @@ Generated on #{Time.now} with options #{h @options.inspect}&lt;br/&gt;
1508
1511
 
1509
1512
 
1510
1513
  <div class="method-source-code" id="threshold-source">
1511
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 171</span>
1514
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 174</span>
1512
1515
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">threshold</span>
1513
1516
  <span class="ruby-ivar">@options</span>[<span class="ruby-value">:threshold</span>] <span class="ruby-operator">||</span> <span class="ruby-value">1.0</span>
1514
1517
  <span class="ruby-keyword">end</span></pre>
@@ -1538,7 +1541,7 @@ Generated on #{Time.now} with options #{h @options.inspect}&lt;br/&gt;
1538
1541
 
1539
1542
 
1540
1543
  <div class="method-source-code" id="title-source">
1541
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 167</span>
1544
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 170</span>
1542
1545
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">title</span>
1543
1546
  <span class="ruby-ivar">@title</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:title</span>) <span class="ruby-operator">||</span> <span class="ruby-string">&quot;ruby-prof call tree&quot;</span>
1544
1547
  <span class="ruby-keyword">end</span></pre>
@@ -1568,7 +1571,7 @@ Generated on #{Time.now} with options #{h @options.inspect}&lt;br/&gt;
1568
1571
 
1569
1572
 
1570
1573
  <div class="method-source-code" id="total_time-source">
1571
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 134</span>
1574
+ <pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 137</span>
1572
1575
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">total_time</span>(<span class="ruby-identifier">call_infos</span>)
1573
1576
  <span class="ruby-identifier">sum</span>(<span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">ci</span><span class="ruby-operator">|</span> <span class="ruby-identifier">ci</span>.<span class="ruby-identifier">total_time</span>})
1574
1577
  <span class="ruby-keyword">end</span></pre>
@@ -1591,7 +1594,7 @@ Generated on #{Time.now} with options #{h @options.inspect}&lt;br/&gt;
1591
1594
 
1592
1595
  <footer id="validator-badges">
1593
1596
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
1594
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
1597
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
1595
1598
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
1596
1599
  </footer>
1597
1600
 
@@ -407,7 +407,7 @@ and similar tools.</p>
407
407
 
408
408
  <footer id="validator-badges">
409
409
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
410
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
410
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
411
411
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
412
412
  </footer>
413
413
 
@@ -663,7 +663,7 @@
663
663
 
664
664
  <footer id="validator-badges">
665
665
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
666
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
666
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
667
667
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
668
668
  </footer>
669
669
 
@@ -306,7 +306,7 @@ to use the :min_percent option, for example:</p>
306
306
 
307
307
  <footer id="validator-badges">
308
308
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
309
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
309
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
310
310
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
311
311
  </footer>
312
312
 
@@ -223,7 +223,7 @@ printer.print(STDOUT, {})</pre>
223
223
 
224
224
  <footer id="validator-badges">
225
225
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
226
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
226
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
227
227
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
228
228
  </footer>
229
229
 
@@ -261,7 +261,7 @@ printer.print(STDOUT, {})</pre>
261
261
 
262
262
  <footer id="validator-badges">
263
263
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
264
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
264
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
265
265
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
266
266
  </footer>
267
267
 
@@ -335,7 +335,7 @@ be printed out.</p>
335
335
  <div class="method-source-code" id="method_href-source">
336
336
  <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 61</span>
337
337
  <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>)
338
- <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">id</span>.<span class="ruby-identifier">to_s</span>)
338
+ <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>)
339
339
  <span class="ruby-keyword">end</span></pre>
340
340
  </div><!-- method_href-source -->
341
341
 
@@ -494,11 +494,17 @@ be printed out.</p>
494
494
  &lt;table&gt;
495
495
  &lt;tr&gt;
496
496
  &lt;th&gt;Thread ID&lt;/th&gt;
497
+ &lt;% if RUBY_VERSION &gt;= &quot;1.9&quot; %&gt;
498
+ &lt;th&gt;Fiber ID&lt;/th&gt;
499
+ &lt;% end %&gt;
497
500
  &lt;th&gt;Total Time&lt;/th&gt;
498
501
  &lt;/tr&gt;
499
502
  &lt;% for thread in @result.threads %&gt;
500
503
  &lt;tr&gt;
501
- &lt;td&gt;&lt;a href=&quot;#&lt;%= thread.id %&gt;&quot;&gt;&lt;%= thread.id %&gt;&lt;/a&gt;&lt;/td&gt;
504
+ &lt;% if RUBY_VERSION &gt;= &quot;1.9&quot; %&gt;
505
+ &lt;td&gt;&lt;%= thread.id %&gt;&lt;/td&gt;
506
+ &lt;% end %&gt;
507
+ &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;
502
508
  &lt;td&gt;&lt;%= thread.total_time %&gt;&lt;/td&gt;
503
509
  &lt;/tr&gt;
504
510
  &lt;% end %&gt;
@@ -508,8 +514,11 @@ be printed out.</p>
508
514
  &lt;% for thread in @result.threads
509
515
  methods = thread.methods
510
516
  total_time = thread.total_time %&gt;
511
- &lt;h2&gt;&lt;a name=&quot;&lt;%= thread.id %&gt;&quot;&gt;Thread &lt;%= thread.id %&gt;&lt;/a&gt;&lt;/h2&gt;
512
-
517
+ &lt;% if RUBY_VERSION &gt;= &quot;1.9&quot; %&gt;
518
+ &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;
519
+ &lt;% else %&gt;
520
+ &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;
521
+ &lt;% end %&gt;
513
522
  &lt;table&gt;
514
523
  &lt;thead&gt;
515
524
  &lt;tr&gt;
@@ -616,7 +625,7 @@ be printed out.</p>
616
625
 
617
626
  <footer id="validator-badges">
618
627
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
619
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
628
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
620
629
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
621
630
  </footer>
622
631