ruby-prof 0.15.5 → 0.15.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +4 -1
- data/doc/RubyProf.html +5 -6
- data/doc/RubyProf/CallInfo.html +259 -11
- data/doc/RubyProf/CallInfoPrinter.html +2 -2
- data/doc/RubyProf/CallInfoVisitor.html +7 -9
- data/doc/RubyProf/DotPrinter.html +2 -2
- data/doc/RubyProf/GraphHtmlPrinter.html +62 -58
- data/doc/RubyProf/MethodInfo.html +230 -30
- data/doc/RubyProf/Profile.html +2 -53
- data/doc/RubyProf/Thread.html +108 -4
- data/doc/created.rid +11 -11
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/table_of_contents.html +120 -50
- data/ext/ruby_prof/rp_call_info.h +1 -1
- data/lib/ruby-prof/call_info.rb +54 -2
- data/lib/ruby-prof/call_info_visitor.rb +10 -12
- data/lib/ruby-prof/method_info.rb +31 -17
- data/lib/ruby-prof/printers/call_info_printer.rb +2 -2
- data/lib/ruby-prof/printers/dot_printer.rb +27 -27
- data/lib/ruby-prof/printers/graph_html_printer.rb +62 -58
- data/lib/ruby-prof/printers/graph_printer.rb +4 -3
- data/lib/ruby-prof/profile.rb +1 -22
- data/lib/ruby-prof/thread.rb +15 -3
- data/lib/ruby-prof/version.rb +1 -1
- data/test/call_info_visitor_test.rb +1 -1
- metadata +1 -1
@@ -208,7 +208,7 @@ RubyProf::Result.</p>
|
|
208
208
|
STDOUT.</p>
|
209
209
|
|
210
210
|
<p>options - Hash of print options. See <a
|
211
|
-
href="AbstractPrinter.html#method-i-setup_options">setup_options</a>
|
211
|
+
href="AbstractPrinter.html#method-i-setup_options">setup_options</a> for
|
212
212
|
more information.</p>
|
213
213
|
|
214
214
|
<p>When profiling results that cover a large number of method calls it helps
|
@@ -225,7 +225,7 @@ to use the :min_percent option, for example:</p>
|
|
225
225
|
<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> = {})
|
226
226
|
<span class="ruby-ivar">@output</span> = <span class="ruby-identifier">output</span>
|
227
227
|
<span class="ruby-identifier">setup_options</span>(<span class="ruby-identifier">options</span>)
|
228
|
-
|
228
|
+
|
229
229
|
<span class="ruby-identifier">puts</span> <span class="ruby-string">'digraph "Profile" {'</span>
|
230
230
|
<span class="ruby-comment">#puts "label=\"#{mode_name} >=#{min_percent}%\\nTotal: #{total_time}\";"</span>
|
231
231
|
<span class="ruby-identifier">puts</span> <span class="ruby-string">"labelloc=t;"</span>
|
@@ -442,7 +442,7 @@ be printed out.</p>
|
|
442
442
|
</style>
|
443
443
|
</head>
|
444
444
|
<body>
|
445
|
-
<h1>Profile Report</h1>
|
445
|
+
<h1>Profile Report: <%= RubyProf.measure_mode_string %></h1>
|
446
446
|
<!-- Threads Table -->
|
447
447
|
<table>
|
448
448
|
<tr>
|
@@ -482,63 +482,67 @@ be printed out.</p>
|
|
482
482
|
<tbody>
|
483
483
|
<% min_time = @options[:min_time] || (@options[:nonzero] ? 0.005 : nil)
|
484
484
|
methods.sort_by(&sort_method).reverse_each do |method|
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
485
|
+
total_percentage = (method.total_time/total_time) * 100
|
486
|
+
|
487
|
+
next if total_percentage < min_percent
|
488
|
+
next if min_time && method.total_time < min_time
|
489
|
+
|
490
|
+
self_percentage = (method.self_time/total_time) * 100 %>
|
491
|
+
|
492
|
+
<!-- Parents -->
|
493
|
+
<% for caller in method.aggregate_parents.sort_by(&:total_time)
|
494
|
+
next unless caller.parent
|
495
|
+
next if min_time && caller.total_time < min_time %>
|
496
|
+
<tr>
|
497
|
+
<td>&nbsp;</td>
|
498
|
+
<td>&nbsp;</td>
|
499
|
+
<td><%= sprintf("%#{TIME_WIDTH}.2f", caller.total_time) %></td>
|
500
|
+
<td><%= sprintf("%#{TIME_WIDTH}.2f", caller.self_time) %></td>
|
501
|
+
<td><%= sprintf("%#{TIME_WIDTH}.2f", caller.wait_time) %></td>
|
502
|
+
<td><%= sprintf("%#{TIME_WIDTH}.2f", caller.children_time) %></td>
|
503
|
+
<% called = "#{caller.called}/#{method.called}" %>
|
504
|
+
<td><%= sprintf("%#{CALL_WIDTH}s", called) %></td>
|
505
|
+
<td class="method_name"><%= create_link(thread, total_time, caller.parent.target) %></td>
|
506
|
+
<td><%= file_link(caller.parent.target.source_file, caller.line) %></td>
|
507
|
+
</tr>
|
508
|
+
<% end %>
|
509
|
+
|
510
|
+
<tr class="method">
|
511
|
+
<td><%= sprintf("%#{PERCENTAGE_WIDTH-1}.2f\%", total_percentage) %></td>
|
512
|
+
<td><%= sprintf("%#{PERCENTAGE_WIDTH-1}.2f\%", self_percentage) %></td>
|
513
|
+
<td><%= sprintf("%#{TIME_WIDTH}.2f", method.total_time) %></td>
|
514
|
+
<td><%= sprintf("%#{TIME_WIDTH}.2f", method.self_time) %></td>
|
515
|
+
<td><%= sprintf("%#{TIME_WIDTH}.2f", method.wait_time) %></td>
|
516
|
+
<td><%= sprintf("%#{TIME_WIDTH}.2f", method.children_time) %></td>
|
517
|
+
<td><%= sprintf("%#{CALL_WIDTH}i", method.called) %></td>
|
518
|
+
<td class="method_name">
|
519
|
+
<a name="<%= method_href(thread, method) %>">
|
520
|
+
<%= method.recursive? ? "*" : " "%><%= h method.full_name %>
|
521
|
+
</a>
|
522
|
+
</td>
|
523
|
+
<td><%= file_link(method.source_file, method.line) %></td>
|
524
|
+
</tr>
|
525
|
+
|
526
|
+
<!-- Children -->
|
527
|
+
<% method.recalc_recursion unless method.non_recursive? %>
|
528
|
+
<% for callee in method.aggregate_children.sort_by(&:total_time).reverse %>
|
529
|
+
<% next if min_time && callee.total_time < min_time %>
|
530
|
+
<tr>
|
531
|
+
<td>&nbsp;</td>
|
532
|
+
<td>&nbsp;</td>
|
533
|
+
<td><%= sprintf("%#{TIME_WIDTH}.2f", callee.total_time) %></td>
|
534
|
+
<td><%= sprintf("%#{TIME_WIDTH}.2f", callee.self_time) %></td>
|
535
|
+
<td><%= sprintf("%#{TIME_WIDTH}.2f", callee.wait_time) %></td>
|
536
|
+
<td><%= sprintf("%#{TIME_WIDTH}.2f", callee.children_time) %></td>
|
537
|
+
<% called = "#{callee.called}/#{callee.target.called}" %>
|
538
|
+
<td><%= sprintf("%#{CALL_WIDTH}s", called) %></td>
|
539
|
+
<td class="method_name"><%= create_link(thread, total_time, callee.target) %></td>
|
540
|
+
<td><%= file_link(method.source_file, callee.line) %></td>
|
541
|
+
</tr>
|
542
|
+
<% end %>
|
543
|
+
<!-- Create divider row -->
|
544
|
+
<tr class="break"><td colspan="9"></td></tr>
|
545
|
+
<% thread.recalc_recursion unless method.non_recursive? %>
|
542
546
|
<% end %>
|
543
547
|
</tbody>
|
544
548
|
<tfoot>
|
@@ -93,10 +93,22 @@
|
|
93
93
|
|
94
94
|
<li ><a href="#method-i-children_time">#children_time</a>
|
95
95
|
|
96
|
+
<li ><a href="#method-i-clear_cached_values_which_depend_on_recursiveness">#clear_cached_values_which_depend_on_recursiveness</a>
|
97
|
+
|
98
|
+
<li ><a href="#method-i-detect_recursion">#detect_recursion</a>
|
99
|
+
|
96
100
|
<li ><a href="#method-i-eliminate-21">#eliminate!</a>
|
97
101
|
|
98
102
|
<li ><a href="#method-i-min_depth">#min_depth</a>
|
99
103
|
|
104
|
+
<li ><a href="#method-i-non_recursive">#non_recursive</a>
|
105
|
+
|
106
|
+
<li ><a href="#method-i-non_recursive-3F">#non_recursive?</a>
|
107
|
+
|
108
|
+
<li ><a href="#method-i-parents">#parents</a>
|
109
|
+
|
110
|
+
<li ><a href="#method-i-recalc_recursion">#recalc_recursion</a>
|
111
|
+
|
100
112
|
<li ><a href="#method-i-recursive-3F">#recursive?</a>
|
101
113
|
|
102
114
|
<li ><a href="#method-i-root-3F">#root?</a>
|
@@ -205,13 +217,12 @@
|
|
205
217
|
|
206
218
|
|
207
219
|
<div class="method-source-code" id="aggregate_children-source">
|
208
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line
|
220
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 120</span>
|
209
221
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">aggregate_children</span>
|
210
222
|
<span class="ruby-comment"># Group call info's based on their targets</span>
|
211
|
-
<span class="ruby-identifier">groups</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">children</span>.<span class="ruby-identifier">
|
223
|
+
<span class="ruby-identifier">groups</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">children</span>.<span class="ruby-identifier">each_with_object</span>({}) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">call_info</span>, <span class="ruby-identifier">hash</span><span class="ruby-operator">|</span>
|
212
224
|
<span class="ruby-identifier">key</span> = <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">target</span>
|
213
225
|
(<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> []) <span class="ruby-operator"><<</span> <span class="ruby-identifier">call_info</span>
|
214
|
-
<span class="ruby-identifier">hash</span>
|
215
226
|
<span class="ruby-keyword">end</span>
|
216
227
|
|
217
228
|
<span class="ruby-identifier">groups</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
@@ -247,13 +258,12 @@
|
|
247
258
|
|
248
259
|
|
249
260
|
<div class="method-source-code" id="aggregate_parents-source">
|
250
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line
|
261
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 108</span>
|
251
262
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">aggregate_parents</span>
|
252
263
|
<span class="ruby-comment"># Group call info's based on their parents</span>
|
253
|
-
<span class="ruby-identifier">groups</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">
|
264
|
+
<span class="ruby-identifier">groups</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">each_with_object</span>({}) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">call_info</span>, <span class="ruby-identifier">hash</span><span class="ruby-operator">|</span>
|
254
265
|
<span class="ruby-identifier">key</span> = <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">parent</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">target</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">self</span>
|
255
266
|
(<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> []) <span class="ruby-operator"><<</span> <span class="ruby-identifier">call_info</span>
|
256
|
-
<span class="ruby-identifier">hash</span>
|
257
267
|
<span class="ruby-keyword">end</span>
|
258
268
|
|
259
269
|
<span class="ruby-identifier">groups</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
@@ -289,7 +299,7 @@
|
|
289
299
|
|
290
300
|
|
291
301
|
<div class="method-source-code" id="called-source">
|
292
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line
|
302
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 32</span>
|
293
303
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">called</span>
|
294
304
|
<span class="ruby-ivar">@called</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
|
295
305
|
<span class="ruby-identifier">call_infos</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>
|
@@ -326,13 +336,9 @@
|
|
326
336
|
|
327
337
|
|
328
338
|
<div class="method-source-code" id="children-source">
|
329
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line
|
339
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 100</span>
|
330
340
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">children</span>
|
331
|
-
<span class="ruby-ivar">@children</span> <span class="ruby-operator">||=</span> <span class="ruby-
|
332
|
-
<span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">call_info</span><span class="ruby-operator">|</span>
|
333
|
-
<span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">children</span>
|
334
|
-
<span class="ruby-keyword">end</span>.<span class="ruby-identifier">flatten</span>
|
335
|
-
<span class="ruby-keyword">end</span>
|
341
|
+
<span class="ruby-ivar">@children</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&</span><span class="ruby-value">:children</span>).<span class="ruby-identifier">flatten</span>
|
336
342
|
<span class="ruby-keyword">end</span></pre>
|
337
343
|
</div>
|
338
344
|
|
@@ -363,11 +369,11 @@
|
|
363
369
|
|
364
370
|
|
365
371
|
<div class="method-source-code" id="children_time-source">
|
366
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line
|
372
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 67</span>
|
367
373
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">children_time</span>
|
368
374
|
<span class="ruby-ivar">@children_time</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
|
369
375
|
<span class="ruby-identifier">call_infos</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>
|
370
|
-
<span class="ruby-identifier">sum</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">children_time</span>
|
376
|
+
<span class="ruby-identifier">sum</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">children_time</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">recursive</span>
|
371
377
|
<span class="ruby-identifier">sum</span>
|
372
378
|
<span class="ruby-keyword">end</span>
|
373
379
|
<span class="ruby-keyword">end</span>
|
@@ -379,6 +385,72 @@
|
|
379
385
|
|
380
386
|
|
381
387
|
|
388
|
+
</div>
|
389
|
+
|
390
|
+
|
391
|
+
<div id="method-i-clear_cached_values_which_depend_on_recursiveness" class="method-detail ">
|
392
|
+
|
393
|
+
<div class="method-heading">
|
394
|
+
<span class="method-name">clear_cached_values_which_depend_on_recursiveness</span><span
|
395
|
+
class="method-args">()</span>
|
396
|
+
|
397
|
+
<span class="method-click-advice">click to toggle source</span>
|
398
|
+
|
399
|
+
</div>
|
400
|
+
|
401
|
+
|
402
|
+
<div class="method-description">
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
<div class="method-source-code" id="clear_cached_values_which_depend_on_recursiveness-source">
|
410
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 28</span>
|
411
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">clear_cached_values_which_depend_on_recursiveness</span>
|
412
|
+
<span class="ruby-ivar">@total_time</span> = <span class="ruby-ivar">@self_time</span> = <span class="ruby-ivar">@wait_time</span> = <span class="ruby-ivar">@children_time</span> = <span class="ruby-keyword">nil</span>
|
413
|
+
<span class="ruby-keyword">end</span></pre>
|
414
|
+
</div>
|
415
|
+
|
416
|
+
</div>
|
417
|
+
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
</div>
|
422
|
+
|
423
|
+
|
424
|
+
<div id="method-i-detect_recursion" class="method-detail ">
|
425
|
+
|
426
|
+
<div class="method-heading">
|
427
|
+
<span class="method-name">detect_recursion</span><span
|
428
|
+
class="method-args">()</span>
|
429
|
+
|
430
|
+
<span class="method-click-advice">click to toggle source</span>
|
431
|
+
|
432
|
+
</div>
|
433
|
+
|
434
|
+
|
435
|
+
<div class="method-description">
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
|
440
|
+
|
441
|
+
|
442
|
+
<div class="method-source-code" id="detect_recursion-source">
|
443
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 20</span>
|
444
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">detect_recursion</span>
|
445
|
+
<span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">each</span>(<span class="ruby-operator">&</span><span class="ruby-value">:detect_recursion</span>)
|
446
|
+
<span class="ruby-keyword">end</span></pre>
|
447
|
+
</div>
|
448
|
+
|
449
|
+
</div>
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
|
382
454
|
</div>
|
383
455
|
|
384
456
|
|
@@ -401,7 +473,7 @@
|
|
401
473
|
|
402
474
|
|
403
475
|
<div class="method-source-code" id="eliminate-21-source">
|
404
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line
|
476
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 137</span>
|
405
477
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">eliminate!</span>
|
406
478
|
<span class="ruby-comment"># $stderr.puts "eliminating #{self}"</span>
|
407
479
|
<span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">call_info</span><span class="ruby-operator">|</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">eliminate!</span> }
|
@@ -436,11 +508,141 @@
|
|
436
508
|
|
437
509
|
|
438
510
|
<div class="method-source-code" id="min_depth-source">
|
439
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line
|
511
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 76</span>
|
440
512
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">min_depth</span>
|
441
|
-
<span class="ruby-ivar">@min_depth</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">map</span>
|
442
|
-
|
443
|
-
|
513
|
+
<span class="ruby-ivar">@min_depth</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&</span><span class="ruby-value">:depth</span>).<span class="ruby-identifier">min</span>
|
514
|
+
<span class="ruby-keyword">end</span></pre>
|
515
|
+
</div>
|
516
|
+
|
517
|
+
</div>
|
518
|
+
|
519
|
+
|
520
|
+
|
521
|
+
|
522
|
+
</div>
|
523
|
+
|
524
|
+
|
525
|
+
<div id="method-i-non_recursive" class="method-detail ">
|
526
|
+
|
527
|
+
<div class="method-heading">
|
528
|
+
<span class="method-name">non_recursive</span><span
|
529
|
+
class="method-args">()</span>
|
530
|
+
|
531
|
+
<span class="method-click-advice">click to toggle source</span>
|
532
|
+
|
533
|
+
</div>
|
534
|
+
|
535
|
+
|
536
|
+
<div class="method-description">
|
537
|
+
|
538
|
+
|
539
|
+
|
540
|
+
|
541
|
+
|
542
|
+
|
543
|
+
<div class="method-source-code" id="non_recursive-source">
|
544
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 96</span>
|
545
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">non_recursive</span>
|
546
|
+
<span class="ruby-ivar">@non_recursive</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">all?</span>(<span class="ruby-operator">&</span><span class="ruby-value">:non_recursive?</span>) <span class="ruby-operator">?</span> <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">0</span>
|
547
|
+
<span class="ruby-keyword">end</span></pre>
|
548
|
+
</div>
|
549
|
+
|
550
|
+
</div>
|
551
|
+
|
552
|
+
|
553
|
+
|
554
|
+
|
555
|
+
</div>
|
556
|
+
|
557
|
+
|
558
|
+
<div id="method-i-non_recursive-3F" class="method-detail ">
|
559
|
+
|
560
|
+
<div class="method-heading">
|
561
|
+
<span class="method-name">non_recursive?</span><span
|
562
|
+
class="method-args">()</span>
|
563
|
+
|
564
|
+
<span class="method-click-advice">click to toggle source</span>
|
565
|
+
|
566
|
+
</div>
|
567
|
+
|
568
|
+
|
569
|
+
<div class="method-description">
|
570
|
+
|
571
|
+
|
572
|
+
|
573
|
+
|
574
|
+
|
575
|
+
|
576
|
+
<div class="method-source-code" id="non_recursive-3F-source">
|
577
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 92</span>
|
578
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">non_recursive?</span>
|
579
|
+
<span class="ruby-identifier">non_recursive</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
|
580
|
+
<span class="ruby-keyword">end</span></pre>
|
581
|
+
</div>
|
582
|
+
|
583
|
+
</div>
|
584
|
+
|
585
|
+
|
586
|
+
|
587
|
+
|
588
|
+
</div>
|
589
|
+
|
590
|
+
|
591
|
+
<div id="method-i-parents" class="method-detail ">
|
592
|
+
|
593
|
+
<div class="method-heading">
|
594
|
+
<span class="method-name">parents</span><span
|
595
|
+
class="method-args">()</span>
|
596
|
+
|
597
|
+
<span class="method-click-advice">click to toggle source</span>
|
598
|
+
|
599
|
+
</div>
|
600
|
+
|
601
|
+
|
602
|
+
<div class="method-description">
|
603
|
+
|
604
|
+
|
605
|
+
|
606
|
+
|
607
|
+
|
608
|
+
|
609
|
+
<div class="method-source-code" id="parents-source">
|
610
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 104</span>
|
611
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">parents</span>
|
612
|
+
<span class="ruby-ivar">@parents</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&</span><span class="ruby-value">:parent</span>)
|
613
|
+
<span class="ruby-keyword">end</span></pre>
|
614
|
+
</div>
|
615
|
+
|
616
|
+
</div>
|
617
|
+
|
618
|
+
|
619
|
+
|
620
|
+
|
621
|
+
</div>
|
622
|
+
|
623
|
+
|
624
|
+
<div id="method-i-recalc_recursion" class="method-detail ">
|
625
|
+
|
626
|
+
<div class="method-heading">
|
627
|
+
<span class="method-name">recalc_recursion</span><span
|
628
|
+
class="method-args">()</span>
|
629
|
+
|
630
|
+
<span class="method-click-advice">click to toggle source</span>
|
631
|
+
|
632
|
+
</div>
|
633
|
+
|
634
|
+
|
635
|
+
<div class="method-description">
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
|
640
|
+
|
641
|
+
|
642
|
+
<div class="method-source-code" id="recalc_recursion-source">
|
643
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 24</span>
|
644
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">recalc_recursion</span>
|
645
|
+
<span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">each</span>(<span class="ruby-operator">&</span><span class="ruby-value">:recalc_recursion</span>)
|
444
646
|
<span class="ruby-keyword">end</span></pre>
|
445
647
|
</div>
|
446
648
|
|
@@ -471,11 +673,9 @@
|
|
471
673
|
|
472
674
|
|
473
675
|
<div class="method-source-code" id="recursive-3F-source">
|
474
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line
|
676
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 88</span>
|
475
677
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">recursive?</span>
|
476
|
-
<span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">detect</span>
|
477
|
-
<span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">recursive</span>
|
478
|
-
<span class="ruby-keyword">end</span>
|
678
|
+
<span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">detect</span>(<span class="ruby-operator">&</span><span class="ruby-value">:recursive</span>)
|
479
679
|
<span class="ruby-keyword">end</span></pre>
|
480
680
|
</div>
|
481
681
|
|
@@ -506,7 +706,7 @@
|
|
506
706
|
|
507
707
|
|
508
708
|
<div class="method-source-code" id="root-3F-source">
|
509
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line
|
709
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 80</span>
|
510
710
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">root?</span>
|
511
711
|
<span class="ruby-ivar">@root</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
|
512
712
|
<span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">find</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">call_info</span><span class="ruby-operator">|</span>
|
@@ -543,11 +743,11 @@
|
|
543
743
|
|
544
744
|
|
545
745
|
<div class="method-source-code" id="self_time-source">
|
546
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line
|
746
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 49</span>
|
547
747
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">self_time</span>
|
548
748
|
<span class="ruby-ivar">@self_time</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
|
549
749
|
<span class="ruby-identifier">call_infos</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>
|
550
|
-
<span class="ruby-identifier">sum</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">self_time</span>
|
750
|
+
<span class="ruby-identifier">sum</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">self_time</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">recursive</span>
|
551
751
|
<span class="ruby-identifier">sum</span>
|
552
752
|
<span class="ruby-keyword">end</span>
|
553
753
|
<span class="ruby-keyword">end</span>
|
@@ -581,7 +781,7 @@
|
|
581
781
|
|
582
782
|
|
583
783
|
<div class="method-source-code" id="to_s-source">
|
584
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line
|
784
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 132</span>
|
585
785
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
586
786
|
<span class="ruby-node">"#{self.full_name} (c: #{self.called}, tt: #{self.total_time}, st: #{self.self_time}, ct: #{self.children_time})"</span>
|
587
787
|
<span class="ruby-keyword">end</span></pre>
|
@@ -614,7 +814,7 @@
|
|
614
814
|
|
615
815
|
|
616
816
|
<div class="method-source-code" id="total_time-source">
|
617
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line
|
817
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 40</span>
|
618
818
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">total_time</span>
|
619
819
|
<span class="ruby-ivar">@total_time</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
|
620
820
|
<span class="ruby-identifier">call_infos</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>
|
@@ -652,7 +852,7 @@
|
|
652
852
|
|
653
853
|
|
654
854
|
<div class="method-source-code" id="wait_time-source">
|
655
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line
|
855
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 58</span>
|
656
856
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">wait_time</span>
|
657
857
|
<span class="ruby-ivar">@wait_time</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
|
658
858
|
<span class="ruby-identifier">call_infos</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>
|