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.
- data/README.rdoc +2 -2
- data/doc/LICENSE.html +1 -1
- data/doc/README_rdoc.html +2 -2
- data/doc/Rack.html +1 -1
- data/doc/Rack/RubyProf.html +2 -2
- data/doc/RubyProf.html +1 -1
- data/doc/RubyProf/AbstractPrinter.html +1 -1
- data/doc/RubyProf/AggregateCallInfo.html +1 -1
- data/doc/RubyProf/CallInfo.html +1 -1
- data/doc/RubyProf/CallInfoPrinter.html +1 -1
- data/doc/RubyProf/CallInfoVisitor.html +1 -1
- data/doc/RubyProf/CallStackPrinter.html +30 -27
- data/doc/RubyProf/CallTreePrinter.html +1 -1
- data/doc/RubyProf/Cmd.html +1 -1
- data/doc/RubyProf/DotPrinter.html +1 -1
- data/doc/RubyProf/FlatPrinter.html +1 -1
- data/doc/RubyProf/FlatPrinterWithLineNumbers.html +1 -1
- data/doc/RubyProf/GraphHtmlPrinter.html +14 -5
- data/doc/RubyProf/GraphPrinter.html +1 -1
- data/doc/RubyProf/MethodInfo.html +1 -1
- data/doc/RubyProf/MultiPrinter.html +1 -1
- data/doc/RubyProf/Profile.html +1 -1
- data/doc/RubyProf/ProfileTask.html +1 -1
- data/doc/RubyProf/Test.html +1 -1
- data/doc/RubyProf/Thread.html +1 -1
- data/doc/created.rid +11 -10
- data/doc/examples/flat_txt.html +1 -1
- data/doc/examples/graph_txt.html +1 -1
- data/doc/index.html +2 -2
- data/doc/js/darkfish.js +9 -7
- data/doc/table_of_contents.html +1 -1
- data/ext/ruby_prof/extconf.rb +2 -0
- data/ext/ruby_prof/rp_thread.c +24 -8
- data/ext/ruby_prof/rp_thread.h +5 -4
- data/ext/ruby_prof/ruby_prof.c +26 -10
- data/ext/ruby_prof/version.h +3 -3
- data/lib/ruby-prof/printers/call_info_printer.rb +2 -1
- data/lib/ruby-prof/printers/call_stack_printer.rb +7 -4
- data/lib/ruby-prof/printers/flat_printer.rb +1 -0
- data/lib/ruby-prof/printers/graph_html_printer.rb +13 -4
- data/lib/ruby-prof/printers/graph_printer.rb +2 -1
- data/lib/ruby-prof/rack.rb +1 -1
- data/ruby-prof.gemspec +1 -1
- data/test/fiber_test.rb +65 -0
- data/test/measure_process_time_test.rb +2 -2
- data/test/multi_printer_test.rb +4 -2
- data/test/printers_test.rb +2 -0
- data/test/stack_printer_test.rb +2 -2
- data/test/test_helper.rb +2 -0
- 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.
|
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">
|
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">></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
|
|
data/doc/Rack/RubyProf.html
CHANGED
@@ -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">></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">></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
|
|
data/doc/RubyProf/CallInfo.html
CHANGED
@@ -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
|
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
|
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
|
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
|
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
|
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">"%s/%d t:%f s:%f w:%f \n"</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
|
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
|
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">"#{@graph_html}##{method_href(call_info.target)}"</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
|
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
|
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[><#\.\?=:]/</span>,<span class="ruby-string">"_"</span>) <span class="ruby-operator">+</span> <span class="ruby-string">"_"</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
|
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">
|
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-
|
625
|
+
<span class="ruby-identifier">thread_info</span> = <span class="ruby-node">"Thread: #{thread.id}"</span>
|
626
|
+
<span class="ruby-identifier">thread_info</span> <span class="ruby-operator"><<</span> <span class="ruby-node">", Fiber: #{thread.fiber_id}"</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"><<</span> <span class="ruby-node">" (#{"%4.2f%%" % ((@overall_time/@overall_threads_time)*100)} ~ #{@overall_time})"</span>
|
628
|
+
<span class="ruby-ivar">@output</span>.<span class="ruby-identifier">print</span> <span class="ruby-node">"<div class=\"thread\">#{thread_info}</div>"</span>
|
626
629
|
<span class="ruby-ivar">@output</span>.<span class="ruby-identifier">print</span> <span class="ruby-string">"<ul name=\"thread\">"</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
|
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">"<div id=\"commands\">
|
671
674
|
<span style=\"font-size: 11pt; font-weight: bold;\">Threshold:</span>
|
@@ -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
|
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">"<style type="text/css">
|
709
712
|
<!--
|
@@ -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
|
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">'<div id="sentinel"></div></body></html>'</span>
|
841
|
+
<span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">'<div id="sentinel"></div></div></body></html>'</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
|
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">"<html><head>"</span>
|
869
872
|
<span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">'<meta http-equiv="content-type" content="text/html; charset=utf-8">'</span>
|
870
873
|
<span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"<title>#{h title}</title>"</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">'</head><body>'</span>
|
876
|
+
<span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">'</head><body><div style="display: inline-block;">'</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
|
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">"<div style="display: none;" id="help">
|
907
910
|
<img src="empty.png"> Enter a decimal value <i>d</i> into the threshold field and click "Apply"
|
@@ -944,7 +947,7 @@ to hide all nodes marked with time values lower than <i>d</i>.<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
|
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">"<script type="text/javascript">
|
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
|
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
|
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">"<div id="titlebar">
|
1450
1453
|
Call tree for application <b>#{h application} #{h arguments}</b><br/>
|
@@ -1478,7 +1481,7 @@ Generated on #{Time.now} with options #{h @options.inspect}<br/>
|
|
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
|
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}<br/>
|
|
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
|
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}<br/>
|
|
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
|
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">"ruby-prof call tree"</span>
|
1544
1547
|
<span class="ruby-keyword">end</span></pre>
|
@@ -1568,7 +1571,7 @@ Generated on #{Time.now} with options #{h @options.inspect}<br/>
|
|
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
|
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}<br/>
|
|
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
|
|
data/doc/RubyProf/Cmd.html
CHANGED
@@ -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[><#\.\?=:]/</span>,<span class="ruby-string">"_"</span>) <span class="ruby-operator">+</span> <span class="ruby-string">"_"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">
|
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[><#\.\?=:]/</span>,<span class="ruby-string">"_"</span>) <span class="ruby-operator">+</span> <span class="ruby-string">"_"</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
|
<table>
|
495
495
|
<tr>
|
496
496
|
<th>Thread ID</th>
|
497
|
+
<% if RUBY_VERSION >= "1.9" %>
|
498
|
+
<th>Fiber ID</th>
|
499
|
+
<% end %>
|
497
500
|
<th>Total Time</th>
|
498
501
|
</tr>
|
499
502
|
<% for thread in @result.threads %>
|
500
503
|
<tr>
|
501
|
-
<
|
504
|
+
<% if RUBY_VERSION >= "1.9" %>
|
505
|
+
<td><%= thread.id %></td>
|
506
|
+
<% end %>
|
507
|
+
<td><a href="#<%= thread.fiber_id %>"><%= thread.fiber_id %></a></td>
|
502
508
|
<td><%= thread.total_time %></td>
|
503
509
|
</tr>
|
504
510
|
<% end %>
|
@@ -508,8 +514,11 @@ be printed out.</p>
|
|
508
514
|
<% for thread in @result.threads
|
509
515
|
methods = thread.methods
|
510
516
|
total_time = thread.total_time %>
|
511
|
-
<
|
512
|
-
|
517
|
+
<% if RUBY_VERSION >= "1.9" %>
|
518
|
+
<h2><a name="<%= thread.fiber_id %>">Thread <%= thread.id %>, Fiber: <%= thread.fiber_id %></a></h2>
|
519
|
+
<% else %>
|
520
|
+
<h2><a name="<%= thread.fiber_id %>">Thread <%= thread.fiber_id %></a></h2>
|
521
|
+
<% end %>
|
513
522
|
<table>
|
514
523
|
<thead>
|
515
524
|
<tr>
|
@@ -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
|
|