ruby-prof 0.17.0 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGES +500 -482
- data/LICENSE +24 -24
- data/README.rdoc +487 -485
- data/Rakefile +113 -113
- data/bin/ruby-prof +345 -345
- data/bin/ruby-prof-check-trace +45 -45
- data/examples/flat.txt +50 -50
- data/examples/graph.dot +84 -84
- data/examples/graph.html +823 -823
- data/examples/graph.txt +139 -139
- data/examples/multi.flat.txt +23 -23
- data/examples/multi.graph.html +760 -760
- data/examples/multi.grind.dat +114 -114
- data/examples/multi.stack.html +547 -547
- data/examples/stack.html +547 -547
- data/ext/ruby_prof/extconf.rb +68 -68
- data/ext/ruby_prof/rp_call_info.c +425 -425
- data/ext/ruby_prof/rp_call_info.h +53 -53
- data/ext/ruby_prof/rp_measure.c +40 -40
- data/ext/ruby_prof/rp_measure.h +45 -45
- data/ext/ruby_prof/rp_measure_allocations.c +76 -76
- data/ext/ruby_prof/rp_measure_cpu_time.c +136 -136
- data/ext/ruby_prof/rp_measure_gc_runs.c +73 -73
- data/ext/ruby_prof/rp_measure_gc_time.c +60 -60
- data/ext/ruby_prof/rp_measure_memory.c +77 -77
- data/ext/ruby_prof/rp_measure_process_time.c +71 -71
- data/ext/ruby_prof/rp_measure_wall_time.c +45 -45
- data/ext/ruby_prof/rp_method.c +630 -636
- data/ext/ruby_prof/rp_method.h +75 -75
- data/ext/ruby_prof/rp_stack.c +173 -173
- data/ext/ruby_prof/rp_stack.h +63 -63
- data/ext/ruby_prof/rp_thread.c +277 -276
- data/ext/ruby_prof/rp_thread.h +27 -27
- data/ext/ruby_prof/ruby_prof.c +794 -774
- data/ext/ruby_prof/ruby_prof.h +60 -59
- data/ext/ruby_prof/vc/ruby_prof.sln +20 -21
- data/ext/ruby_prof/vc/{ruby_prof_20.vcxproj → ruby_prof.vcxproj} +31 -0
- data/lib/ruby-prof.rb +68 -68
- data/lib/ruby-prof/aggregate_call_info.rb +76 -76
- data/lib/ruby-prof/assets/call_stack_printer.css.html +116 -116
- data/lib/ruby-prof/assets/call_stack_printer.js.html +384 -384
- data/lib/ruby-prof/call_info.rb +115 -115
- data/lib/ruby-prof/call_info_visitor.rb +40 -40
- data/lib/ruby-prof/compatibility.rb +179 -178
- data/lib/ruby-prof/method_info.rb +121 -121
- data/lib/ruby-prof/printers/abstract_printer.rb +104 -103
- data/lib/ruby-prof/printers/call_info_printer.rb +41 -41
- data/lib/ruby-prof/printers/call_stack_printer.rb +265 -265
- data/lib/ruby-prof/printers/call_tree_printer.rb +143 -143
- data/lib/ruby-prof/printers/dot_printer.rb +132 -132
- data/lib/ruby-prof/printers/flat_printer.rb +70 -70
- data/lib/ruby-prof/printers/flat_printer_with_line_numbers.rb +83 -83
- data/lib/ruby-prof/printers/graph_html_printer.rb +249 -249
- data/lib/ruby-prof/printers/graph_printer.rb +116 -116
- data/lib/ruby-prof/printers/multi_printer.rb +84 -84
- data/lib/ruby-prof/profile.rb +26 -26
- data/lib/ruby-prof/profile/exclude_common_methods.rb +207 -201
- data/lib/ruby-prof/profile/legacy_method_elimination.rb +50 -49
- data/lib/ruby-prof/rack.rb +174 -174
- data/lib/ruby-prof/task.rb +147 -147
- data/lib/ruby-prof/thread.rb +35 -35
- data/lib/ruby-prof/version.rb +3 -3
- data/lib/unprof.rb +10 -10
- data/ruby-prof.gemspec +58 -58
- data/test/abstract_printer_test.rb +53 -0
- data/test/aggregate_test.rb +136 -136
- data/test/basic_test.rb +128 -128
- data/test/block_test.rb +74 -74
- data/test/call_info_test.rb +78 -78
- data/test/call_info_visitor_test.rb +31 -31
- data/test/duplicate_names_test.rb +32 -32
- data/test/dynamic_method_test.rb +55 -55
- data/test/enumerable_test.rb +21 -21
- data/test/exceptions_test.rb +24 -16
- data/test/exclude_methods_test.rb +146 -146
- data/test/exclude_threads_test.rb +53 -53
- data/test/fiber_test.rb +79 -79
- data/test/issue137_test.rb +63 -63
- data/test/line_number_test.rb +80 -80
- data/test/measure_allocations_test.rb +26 -26
- data/test/measure_cpu_time_test.rb +212 -213
- data/test/measure_gc_runs_test.rb +32 -32
- data/test/measure_gc_time_test.rb +36 -36
- data/test/measure_memory_test.rb +33 -33
- data/test/measure_process_time_test.rb +61 -63
- data/test/measure_wall_time_test.rb +255 -255
- data/test/method_elimination_test.rb +84 -84
- data/test/module_test.rb +45 -45
- data/test/multi_printer_test.rb +104 -104
- data/test/no_method_class_test.rb +15 -15
- data/test/pause_resume_test.rb +166 -166
- data/test/prime.rb +54 -54
- data/test/printers_test.rb +275 -275
- data/test/printing_recursive_graph_test.rb +127 -127
- data/test/rack_test.rb +157 -157
- data/test/recursive_test.rb +215 -215
- data/test/singleton_test.rb +38 -38
- data/test/stack_printer_test.rb +77 -78
- data/test/stack_test.rb +138 -138
- data/test/start_stop_test.rb +112 -112
- data/test/test_helper.rb +267 -275
- data/test/thread_test.rb +187 -187
- data/test/unique_call_path_test.rb +202 -202
- data/test/yarv_test.rb +55 -55
- metadata +17 -96
- data/doc/LICENSE.html +0 -115
- data/doc/README_rdoc.html +0 -637
- data/doc/Rack.html +0 -96
- data/doc/Rack/RubyProf.html +0 -233
- data/doc/Rack/RubyProf/RackProfiler.html +0 -343
- data/doc/RubyProf.html +0 -974
- data/doc/RubyProf/AbstractPrinter.html +0 -625
- data/doc/RubyProf/AggregateCallInfo.html +0 -552
- data/doc/RubyProf/CallInfo.html +0 -579
- data/doc/RubyProf/CallInfoPrinter.html +0 -121
- data/doc/RubyProf/CallInfoVisitor.html +0 -199
- data/doc/RubyProf/CallStackPrinter.html +0 -1127
- data/doc/RubyProf/CallTreePrinter.html +0 -725
- data/doc/RubyProf/Cmd.html +0 -637
- data/doc/RubyProf/DeprecationWarnings.html +0 -148
- data/doc/RubyProf/DotPrinter.html +0 -258
- data/doc/RubyProf/FlatPrinter.html +0 -164
- data/doc/RubyProf/FlatPrinterWithLineNumbers.html +0 -210
- data/doc/RubyProf/GraphHtmlPrinter.html +0 -558
- data/doc/RubyProf/GraphPrinter.html +0 -140
- data/doc/RubyProf/MethodInfo.html +0 -676
- data/doc/RubyProf/MultiPrinter.html +0 -574
- data/doc/RubyProf/Profile.html +0 -908
- data/doc/RubyProf/Profile/ExcludeCommonMethods.html +0 -411
- data/doc/RubyProf/Profile/LegacyMethodElimination.html +0 -158
- data/doc/RubyProf/ProfileTask.html +0 -491
- data/doc/RubyProf/Thread.html +0 -275
- data/doc/created.rid +0 -33
- data/doc/css/fonts.css +0 -167
- data/doc/css/rdoc.css +0 -590
- data/doc/examples/flat_txt.html +0 -139
- data/doc/examples/graph_html.html +0 -910
- data/doc/examples/graph_txt.html +0 -248
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +0 -666
- data/doc/js/darkfish.js +0 -161
- data/doc/js/jquery.js +0 -4
- data/doc/js/navigation.js +0 -142
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search.js +0 -109
- data/doc/js/search_index.js +0 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js +0 -229
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +0 -1052
- data/examples/cachegrind.out.1 +0 -114
- data/examples/cachegrind.out.1.32313213 +0 -114
- data/ext/ruby_prof/vc/ruby_prof_18.vcxproj +0 -108
- data/ext/ruby_prof/vc/ruby_prof_19.vcxproj +0 -110
@@ -1,210 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>class RubyProf::FlatPrinterWithLineNumbers - ruby-prof</title>
|
8
|
-
|
9
|
-
<script type="text/javascript">
|
10
|
-
var rdoc_rel_prefix = "../";
|
11
|
-
var index_rel_prefix = "../";
|
12
|
-
</script>
|
13
|
-
|
14
|
-
<script src="../js/jquery.js"></script>
|
15
|
-
<script src="../js/darkfish.js"></script>
|
16
|
-
|
17
|
-
<link href="../css/fonts.css" rel="stylesheet">
|
18
|
-
<link href="../css/rdoc.css" rel="stylesheet">
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
<body id="top" role="document" class="class">
|
23
|
-
<nav role="navigation">
|
24
|
-
<div id="project-navigation">
|
25
|
-
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
26
|
-
<h2>
|
27
|
-
<a href="../index.html" rel="home">Home</a>
|
28
|
-
</h2>
|
29
|
-
|
30
|
-
<div id="table-of-contents-navigation">
|
31
|
-
<a href="../table_of_contents.html#pages">Pages</a>
|
32
|
-
<a href="../table_of_contents.html#classes">Classes</a>
|
33
|
-
<a href="../table_of_contents.html#methods">Methods</a>
|
34
|
-
</div>
|
35
|
-
</div>
|
36
|
-
|
37
|
-
<div id="search-section" role="search" class="project-section initially-hidden">
|
38
|
-
<form action="#" method="get" accept-charset="utf-8">
|
39
|
-
<div id="search-field-wrapper">
|
40
|
-
<input id="search-field" role="combobox" aria-label="Search"
|
41
|
-
aria-autocomplete="list" aria-controls="search-results"
|
42
|
-
type="text" name="search" placeholder="Search" spellcheck="false"
|
43
|
-
title="Type to search, Up and Down to navigate, Enter to load">
|
44
|
-
</div>
|
45
|
-
|
46
|
-
<ul id="search-results" aria-label="Search Results"
|
47
|
-
aria-busy="false" aria-expanded="false"
|
48
|
-
aria-atomic="false" class="initially-hidden"></ul>
|
49
|
-
</form>
|
50
|
-
</div>
|
51
|
-
|
52
|
-
</div>
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
<div id="class-metadata">
|
57
|
-
|
58
|
-
<div id="parent-class-section" class="nav-section">
|
59
|
-
<h3>Parent</h3>
|
60
|
-
|
61
|
-
|
62
|
-
<p class="link"><a href="FlatPrinter.html">RubyProf::FlatPrinter</a>
|
63
|
-
|
64
|
-
</div>
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
<!-- Method Quickref -->
|
69
|
-
<div id="method-list-section" class="nav-section">
|
70
|
-
<h3>Methods</h3>
|
71
|
-
|
72
|
-
<ul class="link-list" role="directory">
|
73
|
-
|
74
|
-
<li ><a href="#method-i-print_methods">#print_methods</a>
|
75
|
-
|
76
|
-
</ul>
|
77
|
-
</div>
|
78
|
-
|
79
|
-
</div>
|
80
|
-
</nav>
|
81
|
-
|
82
|
-
<main role="main" aria-labelledby="class-RubyProf::FlatPrinterWithLineNumbers">
|
83
|
-
<h1 id="class-RubyProf::FlatPrinterWithLineNumbers" class="class">
|
84
|
-
class RubyProf::FlatPrinterWithLineNumbers
|
85
|
-
</h1>
|
86
|
-
|
87
|
-
<section class="description">
|
88
|
-
|
89
|
-
<p>Generates <a href="../files/examples/flat_txt.html">flat</a> profile
|
90
|
-
reports as text. To use the flat printer with line numbers:</p>
|
91
|
-
|
92
|
-
<pre>result = RubyProf.profile do
|
93
|
-
[code to profile]
|
94
|
-
end
|
95
|
-
|
96
|
-
printer = RubyProf::FlatPrinterWithLineNumbers.new(result)
|
97
|
-
printer.print(STDOUT, {})</pre>
|
98
|
-
|
99
|
-
</section>
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
115
|
-
<header>
|
116
|
-
<h3>Public Instance Methods</h3>
|
117
|
-
</header>
|
118
|
-
|
119
|
-
|
120
|
-
<div id="method-i-print_methods" class="method-detail ">
|
121
|
-
|
122
|
-
<div class="method-heading">
|
123
|
-
<span class="method-name">print_methods</span><span
|
124
|
-
class="method-args">(thread)</span>
|
125
|
-
|
126
|
-
<span class="method-click-advice">click to toggle source</span>
|
127
|
-
|
128
|
-
</div>
|
129
|
-
|
130
|
-
|
131
|
-
<div class="method-description">
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
<div class="method-source-code" id="print_methods-source">
|
139
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/flat_printer_with_line_numbers.rb, line 14</span>
|
140
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print_methods</span>(<span class="ruby-identifier">thread</span>)
|
141
|
-
<span class="ruby-ivar">@editor</span> = <span class="ruby-identifier">editor_uri</span>
|
142
|
-
<span class="ruby-identifier">total_time</span> = <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">total_time</span>
|
143
|
-
|
144
|
-
<span class="ruby-identifier">methods</span> = <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">methods</span>.<span class="ruby-identifier">sort_by</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">sort_method</span>).<span class="ruby-identifier">reverse</span>
|
145
|
-
<span class="ruby-identifier">sum</span> = <span class="ruby-value">0</span>
|
146
|
-
<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">method</span><span class="ruby-operator">|</span>
|
147
|
-
<span class="ruby-identifier">self_percent</span> = (<span class="ruby-identifier">method</span>.<span class="ruby-identifier">self_time</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">total_time</span>) <span class="ruby-operator">*</span> <span class="ruby-value">100</span>
|
148
|
-
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">self_percent</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">min_percent</span>
|
149
|
-
|
150
|
-
<span class="ruby-identifier">sum</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">self_time</span>
|
151
|
-
<span class="ruby-comment">#self_time_called = method.called > 0 ? method.self_time/method.called : 0</span>
|
152
|
-
<span class="ruby-comment">#total_time_called = method.called > 0? method.total_time/method.called : 0</span>
|
153
|
-
|
154
|
-
<span class="ruby-ivar">@output</span> <span class="ruby-operator"><<</span> <span class="ruby-string">"%6.2f %9.3f %9.3f %9.3f %9.3f %8d %s%s"</span> <span class="ruby-operator">%</span> [
|
155
|
-
<span class="ruby-identifier">method</span>.<span class="ruby-identifier">self_time</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">total_time</span> <span class="ruby-operator">*</span> <span class="ruby-value">100</span>, <span class="ruby-comment"># %self</span>
|
156
|
-
<span class="ruby-identifier">method</span>.<span class="ruby-identifier">total_time</span>, <span class="ruby-comment"># total</span>
|
157
|
-
<span class="ruby-identifier">method</span>.<span class="ruby-identifier">self_time</span>, <span class="ruby-comment"># self</span>
|
158
|
-
<span class="ruby-identifier">method</span>.<span class="ruby-identifier">wait_time</span>, <span class="ruby-comment"># wait</span>
|
159
|
-
<span class="ruby-identifier">method</span>.<span class="ruby-identifier">children_time</span>, <span class="ruby-comment"># children</span>
|
160
|
-
<span class="ruby-identifier">method</span>.<span class="ruby-identifier">called</span>, <span class="ruby-comment"># calls</span>
|
161
|
-
<span class="ruby-identifier">method</span>.<span class="ruby-identifier">recursive?</span> <span class="ruby-operator">?</span> <span class="ruby-string">"*"</span> <span class="ruby-operator">:</span> <span class="ruby-string">" "</span>, <span class="ruby-comment"># cycle</span>
|
162
|
-
<span class="ruby-identifier">method_name</span>(<span class="ruby-identifier">method</span>) <span class="ruby-comment"># name</span>
|
163
|
-
]
|
164
|
-
<span class="ruby-keyword">if</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">source_file</span> <span class="ruby-operator">==</span> <span class="ruby-string">'ruby_runtime'</span>
|
165
|
-
<span class="ruby-ivar">@output</span> <span class="ruby-operator"><<</span> <span class="ruby-string">"\n"</span>
|
166
|
-
<span class="ruby-keyword">else</span>
|
167
|
-
<span class="ruby-ivar">@output</span> <span class="ruby-operator"><<</span> <span class="ruby-string">"\n defined at:\n"</span>
|
168
|
-
<span class="ruby-ivar">@output</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">defined_at_format</span> <span class="ruby-operator">%</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>), <span class="ruby-identifier">method</span>.<span class="ruby-identifier">line</span>]
|
169
|
-
<span class="ruby-keyword">end</span>
|
170
|
-
|
171
|
-
<span class="ruby-identifier">callers</span> = []
|
172
|
-
<span class="ruby-identifier">method</span>.<span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ci</span><span class="ruby-operator">|</span>
|
173
|
-
<span class="ruby-keyword">if</span> <span class="ruby-identifier">ci</span>.<span class="ruby-identifier">parent</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">ci</span>.<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">target</span>.<span class="ruby-identifier">source_file</span> <span class="ruby-operator">!=</span> <span class="ruby-string">'ruby_runtime'</span>
|
174
|
-
<span class="ruby-identifier">callers</span> <span class="ruby-operator"><<</span> [<span class="ruby-identifier">method_name</span>(<span class="ruby-identifier">ci</span>.<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">target</span>), <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">ci</span>.<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">target</span>.<span class="ruby-identifier">source_file</span>), <span class="ruby-identifier">ci</span>.<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">target</span>.<span class="ruby-identifier">line</span>]
|
175
|
-
<span class="ruby-keyword">end</span>
|
176
|
-
<span class="ruby-keyword">end</span>
|
177
|
-
<span class="ruby-comment"># make sure callers are unique</span>
|
178
|
-
<span class="ruby-identifier">callers</span>.<span class="ruby-identifier">uniq!</span>
|
179
|
-
|
180
|
-
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">callers</span>.<span class="ruby-identifier">empty?</span>
|
181
|
-
<span class="ruby-ivar">@output</span> <span class="ruby-operator"><<</span> <span class="ruby-string">" called from:\n"</span>
|
182
|
-
<span class="ruby-identifier">callers</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">args</span><span class="ruby-operator">|</span>
|
183
|
-
<span class="ruby-ivar">@output</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">called_from_format</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">args</span>
|
184
|
-
<span class="ruby-keyword">end</span>
|
185
|
-
<span class="ruby-keyword">end</span>
|
186
|
-
<span class="ruby-ivar">@output</span> <span class="ruby-operator"><<</span> <span class="ruby-string">"\n"</span>
|
187
|
-
<span class="ruby-keyword">end</span>
|
188
|
-
<span class="ruby-keyword">end</span></pre>
|
189
|
-
</div>
|
190
|
-
|
191
|
-
</div>
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
</div>
|
197
|
-
|
198
|
-
|
199
|
-
</section>
|
200
|
-
|
201
|
-
</section>
|
202
|
-
</main>
|
203
|
-
|
204
|
-
|
205
|
-
<footer id="validator-badges" role="contentinfo">
|
206
|
-
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
207
|
-
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
208
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
209
|
-
</footer>
|
210
|
-
|
@@ -1,558 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>class RubyProf::GraphHtmlPrinter - ruby-prof</title>
|
8
|
-
|
9
|
-
<script type="text/javascript">
|
10
|
-
var rdoc_rel_prefix = "../";
|
11
|
-
var index_rel_prefix = "../";
|
12
|
-
</script>
|
13
|
-
|
14
|
-
<script src="../js/jquery.js"></script>
|
15
|
-
<script src="../js/darkfish.js"></script>
|
16
|
-
|
17
|
-
<link href="../css/fonts.css" rel="stylesheet">
|
18
|
-
<link href="../css/rdoc.css" rel="stylesheet">
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
<body id="top" role="document" class="class">
|
23
|
-
<nav role="navigation">
|
24
|
-
<div id="project-navigation">
|
25
|
-
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
26
|
-
<h2>
|
27
|
-
<a href="../index.html" rel="home">Home</a>
|
28
|
-
</h2>
|
29
|
-
|
30
|
-
<div id="table-of-contents-navigation">
|
31
|
-
<a href="../table_of_contents.html#pages">Pages</a>
|
32
|
-
<a href="../table_of_contents.html#classes">Classes</a>
|
33
|
-
<a href="../table_of_contents.html#methods">Methods</a>
|
34
|
-
</div>
|
35
|
-
</div>
|
36
|
-
|
37
|
-
<div id="search-section" role="search" class="project-section initially-hidden">
|
38
|
-
<form action="#" method="get" accept-charset="utf-8">
|
39
|
-
<div id="search-field-wrapper">
|
40
|
-
<input id="search-field" role="combobox" aria-label="Search"
|
41
|
-
aria-autocomplete="list" aria-controls="search-results"
|
42
|
-
type="text" name="search" placeholder="Search" spellcheck="false"
|
43
|
-
title="Type to search, Up and Down to navigate, Enter to load">
|
44
|
-
</div>
|
45
|
-
|
46
|
-
<ul id="search-results" aria-label="Search Results"
|
47
|
-
aria-busy="false" aria-expanded="false"
|
48
|
-
aria-atomic="false" class="initially-hidden"></ul>
|
49
|
-
</form>
|
50
|
-
</div>
|
51
|
-
|
52
|
-
</div>
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
<div id="class-metadata">
|
57
|
-
|
58
|
-
<div id="parent-class-section" class="nav-section">
|
59
|
-
<h3>Parent</h3>
|
60
|
-
|
61
|
-
|
62
|
-
<p class="link"><a href="AbstractPrinter.html">RubyProf::AbstractPrinter</a>
|
63
|
-
|
64
|
-
</div>
|
65
|
-
|
66
|
-
<div id="includes-section" class="nav-section">
|
67
|
-
<h3>Included Modules</h3>
|
68
|
-
|
69
|
-
<ul class="link-list">
|
70
|
-
|
71
|
-
|
72
|
-
<li><span class="include">ERB::Util</span>
|
73
|
-
|
74
|
-
|
75
|
-
</ul>
|
76
|
-
</div>
|
77
|
-
|
78
|
-
|
79
|
-
<!-- Method Quickref -->
|
80
|
-
<div id="method-list-section" class="nav-section">
|
81
|
-
<h3>Methods</h3>
|
82
|
-
|
83
|
-
<ul class="link-list" role="directory">
|
84
|
-
|
85
|
-
<li ><a href="#method-i-create_link">#create_link</a>
|
86
|
-
|
87
|
-
<li ><a href="#method-i-file_link">#file_link</a>
|
88
|
-
|
89
|
-
<li ><a href="#method-i-method_href">#method_href</a>
|
90
|
-
|
91
|
-
<li ><a href="#method-i-print">#print</a>
|
92
|
-
|
93
|
-
<li class="calls-super" ><a href="#method-i-setup_options">#setup_options</a>
|
94
|
-
|
95
|
-
<li ><a href="#method-i-template">#template</a>
|
96
|
-
|
97
|
-
</ul>
|
98
|
-
</div>
|
99
|
-
|
100
|
-
</div>
|
101
|
-
</nav>
|
102
|
-
|
103
|
-
<main role="main" aria-labelledby="class-RubyProf::GraphHtmlPrinter">
|
104
|
-
<h1 id="class-RubyProf::GraphHtmlPrinter" class="class">
|
105
|
-
class RubyProf::GraphHtmlPrinter
|
106
|
-
</h1>
|
107
|
-
|
108
|
-
<section class="description">
|
109
|
-
|
110
|
-
<p>Generates <a href="../files/examples/graph_html.html">graph</a> profile
|
111
|
-
reports as html. To use the graph html printer:</p>
|
112
|
-
|
113
|
-
<pre>result = RubyProf.profile do
|
114
|
-
[code to profile]
|
115
|
-
end
|
116
|
-
|
117
|
-
printer = RubyProf::GraphHtmlPrinter.new(result)
|
118
|
-
printer.print(STDOUT, :min_percent=>0)</pre>
|
119
|
-
|
120
|
-
<p>The Graph printer takes the following options in its print methods:</p>
|
121
|
-
|
122
|
-
<pre>:filename - specify a file to use that contains the ERB
|
123
|
-
template to use, instead of the built-in self.template
|
124
|
-
|
125
|
-
:template - specify an ERB template to use, instead of the
|
126
|
-
built-in self.template
|
127
|
-
|
128
|
-
:editor_uri - Specifies editor uri scheme used for opening files
|
129
|
-
e.g. :atm or :mvim. For OS X default is :txmt.
|
130
|
-
Use RUBY_PROF_EDITOR_URI environment variable to overide.</pre>
|
131
|
-
|
132
|
-
</section>
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
148
|
-
<header>
|
149
|
-
<h3>Public Instance Methods</h3>
|
150
|
-
</header>
|
151
|
-
|
152
|
-
|
153
|
-
<div id="method-i-create_link" class="method-detail ">
|
154
|
-
|
155
|
-
<div class="method-heading">
|
156
|
-
<span class="method-name">create_link</span><span
|
157
|
-
class="method-args">(thread, overall_time, method)</span>
|
158
|
-
|
159
|
-
<span class="method-click-advice">click to toggle source</span>
|
160
|
-
|
161
|
-
</div>
|
162
|
-
|
163
|
-
|
164
|
-
<div class="method-description">
|
165
|
-
|
166
|
-
<p>Creates a link to a method. Note that we do not create links to methods
|
167
|
-
which are under the min_perecent specified by the user, since they will not
|
168
|
-
be printed out.</p>
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
<div class="method-source-code" id="create_link-source">
|
174
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 49</span>
|
175
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">create_link</span>(<span class="ruby-identifier">thread</span>, <span class="ruby-identifier">overall_time</span>, <span class="ruby-identifier">method</span>)
|
176
|
-
<span class="ruby-identifier">total_percent</span> = (<span class="ruby-identifier">method</span>.<span class="ruby-identifier">total_time</span><span class="ruby-operator">/</span><span class="ruby-identifier">overall_time</span>) <span class="ruby-operator">*</span> <span class="ruby-value">100</span>
|
177
|
-
<span class="ruby-keyword">if</span> <span class="ruby-identifier">total_percent</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">min_percent</span>
|
178
|
-
<span class="ruby-comment"># Just return name</span>
|
179
|
-
<span class="ruby-identifier">h</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">full_name</span>
|
180
|
-
<span class="ruby-keyword">else</span>
|
181
|
-
<span class="ruby-identifier">href</span> = <span class="ruby-string">'#'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">method_href</span>(<span class="ruby-identifier">thread</span>, <span class="ruby-identifier">method</span>)
|
182
|
-
<span class="ruby-node">"<a href=\"#{href}\">#{h method.full_name}</a>"</span>
|
183
|
-
<span class="ruby-keyword">end</span>
|
184
|
-
<span class="ruby-keyword">end</span></pre>
|
185
|
-
</div>
|
186
|
-
|
187
|
-
</div>
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
</div>
|
193
|
-
|
194
|
-
|
195
|
-
<div id="method-i-file_link" class="method-detail ">
|
196
|
-
|
197
|
-
<div class="method-heading">
|
198
|
-
<span class="method-name">file_link</span><span
|
199
|
-
class="method-args">(path, linenum)</span>
|
200
|
-
|
201
|
-
<span class="method-click-advice">click to toggle source</span>
|
202
|
-
|
203
|
-
</div>
|
204
|
-
|
205
|
-
|
206
|
-
<div class="method-description">
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
<div class="method-source-code" id="file_link-source">
|
214
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 64</span>
|
215
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">file_link</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">linenum</span>)
|
216
|
-
<span class="ruby-identifier">srcfile</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">path</span>)
|
217
|
-
<span class="ruby-keyword">if</span> <span class="ruby-identifier">srcfile</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/\/ruby_runtime$/</span>
|
218
|
-
<span class="ruby-string">""</span>
|
219
|
-
<span class="ruby-keyword">else</span>
|
220
|
-
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@editor</span>
|
221
|
-
<span class="ruby-node">"<a href=\"#{@editor}://"</span> <span class="ruby-node">"open?url=file://#{h srcfile}&line=#{linenum}\""</span> <span class="ruby-node">"title=\"#{h srcfile}:#{linenum}\">#{linenum}</a>"</span>
|
222
|
-
<span class="ruby-keyword">else</span>
|
223
|
-
<span class="ruby-node">"<a href=\"file://#{h srcfile}##{linenum}\" title=\"#{h srcfile}:#{linenum}\">#{linenum}</a>"</span>
|
224
|
-
<span class="ruby-keyword">end</span>
|
225
|
-
<span class="ruby-keyword">end</span>
|
226
|
-
<span class="ruby-keyword">end</span></pre>
|
227
|
-
</div>
|
228
|
-
|
229
|
-
</div>
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
</div>
|
235
|
-
|
236
|
-
|
237
|
-
<div id="method-i-method_href" class="method-detail ">
|
238
|
-
|
239
|
-
<div class="method-heading">
|
240
|
-
<span class="method-name">method_href</span><span
|
241
|
-
class="method-args">(thread, method)</span>
|
242
|
-
|
243
|
-
<span class="method-click-advice">click to toggle source</span>
|
244
|
-
|
245
|
-
</div>
|
246
|
-
|
247
|
-
|
248
|
-
<div class="method-description">
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
<div class="method-source-code" id="method_href-source">
|
256
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 60</span>
|
257
|
-
<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>)
|
258
|
-
<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">/[><#\.\?=:]/</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>)
|
259
|
-
<span class="ruby-keyword">end</span></pre>
|
260
|
-
</div>
|
261
|
-
|
262
|
-
</div>
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
</div>
|
268
|
-
|
269
|
-
|
270
|
-
<div id="method-i-print" class="method-detail ">
|
271
|
-
|
272
|
-
<div class="method-heading">
|
273
|
-
<span class="method-name">print</span><span
|
274
|
-
class="method-args">(output = STDOUT, options = {})</span>
|
275
|
-
|
276
|
-
<span class="method-click-advice">click to toggle source</span>
|
277
|
-
|
278
|
-
</div>
|
279
|
-
|
280
|
-
|
281
|
-
<div class="method-description">
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
<div class="method-source-code" id="print-source">
|
289
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 38</span>
|
290
|
-
<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> = {})
|
291
|
-
<span class="ruby-ivar">@output</span> = <span class="ruby-identifier">output</span>
|
292
|
-
<span class="ruby-identifier">setup_options</span>(<span class="ruby-identifier">options</span>)
|
293
|
-
<span class="ruby-ivar">@editor</span> = <span class="ruby-identifier">editor_uri</span>
|
294
|
-
<span class="ruby-ivar">@output</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@erb</span>.<span class="ruby-identifier">result</span>(<span class="ruby-identifier">binding</span>).<span class="ruby-identifier">split</span>(<span class="ruby-string">"\n"</span>).<span class="ruby-identifier">map</span>(<span class="ruby-operator">&</span><span class="ruby-value">:rstrip</span>).<span class="ruby-identifier">join</span>(<span class="ruby-string">"\n"</span>) <span class="ruby-operator"><<</span> <span class="ruby-string">"\n"</span>
|
295
|
-
<span class="ruby-keyword">end</span></pre>
|
296
|
-
</div>
|
297
|
-
|
298
|
-
</div>
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
</div>
|
304
|
-
|
305
|
-
|
306
|
-
<div id="method-i-setup_options" class="method-detail ">
|
307
|
-
|
308
|
-
<div class="method-heading">
|
309
|
-
<span class="method-name">setup_options</span><span
|
310
|
-
class="method-args">(options)</span>
|
311
|
-
|
312
|
-
<span class="method-click-advice">click to toggle source</span>
|
313
|
-
|
314
|
-
</div>
|
315
|
-
|
316
|
-
|
317
|
-
<div class="method-description">
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
<div class="method-calls-super">
|
323
|
-
Calls superclass method
|
324
|
-
<a href="AbstractPrinter.html#method-i-setup_options">RubyProf::AbstractPrinter#setup_options</a>
|
325
|
-
</div>
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
<div class="method-source-code" id="setup_options-source">
|
330
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 29</span>
|
331
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">setup_options</span>(<span class="ruby-identifier">options</span>)
|
332
|
-
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">options</span>)
|
333
|
-
|
334
|
-
<span class="ruby-identifier">filename</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:filename</span>]
|
335
|
-
<span class="ruby-identifier">template</span> = <span class="ruby-identifier">filename</span> <span class="ruby-operator">?</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">filename</span>).<span class="ruby-identifier">untaint</span> <span class="ruby-operator">:</span> (<span class="ruby-identifier">options</span>[<span class="ruby-value">:template</span>] <span class="ruby-operator">||</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">template</span>)
|
336
|
-
<span class="ruby-ivar">@erb</span> = <span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">template</span>)
|
337
|
-
<span class="ruby-ivar">@erb</span>.<span class="ruby-identifier">filename</span> = <span class="ruby-identifier">filename</span>
|
338
|
-
<span class="ruby-keyword">end</span></pre>
|
339
|
-
</div>
|
340
|
-
|
341
|
-
</div>
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
</div>
|
347
|
-
|
348
|
-
|
349
|
-
<div id="method-i-template" class="method-detail ">
|
350
|
-
|
351
|
-
<div class="method-heading">
|
352
|
-
<span class="method-name">template</span><span
|
353
|
-
class="method-args">()</span>
|
354
|
-
|
355
|
-
<span class="method-click-advice">click to toggle source</span>
|
356
|
-
|
357
|
-
</div>
|
358
|
-
|
359
|
-
|
360
|
-
<div class="method-description">
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
<div class="method-source-code" id="template-source">
|
368
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 79</span>
|
369
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">template</span>
|
370
|
-
<span class="ruby-string">'
|
371
|
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
372
|
-
<html>
|
373
|
-
<head>
|
374
|
-
<style media="all" type="text/css">
|
375
|
-
table {
|
376
|
-
border-collapse: collapse;
|
377
|
-
border: 1px solid #CCC;
|
378
|
-
font-family: Verdana, Arial, Helvetica, sans-serif;
|
379
|
-
font-size: 9pt;
|
380
|
-
line-height: normal;
|
381
|
-
width: 100%;
|
382
|
-
}
|
383
|
-
|
384
|
-
th {
|
385
|
-
text-align: center;
|
386
|
-
border-top: 1px solid #FB7A31;
|
387
|
-
border-bottom: 1px solid #FB7A31;
|
388
|
-
background: #FFC;
|
389
|
-
padding: 0.3em;
|
390
|
-
border-left: 1px solid silver;
|
391
|
-
}
|
392
|
-
|
393
|
-
tr.break td {
|
394
|
-
border: 0;
|
395
|
-
border-top: 1px solid #FB7A31;
|
396
|
-
padding: 0;
|
397
|
-
margin: 0;
|
398
|
-
}
|
399
|
-
|
400
|
-
tr.method td {
|
401
|
-
font-weight: bold;
|
402
|
-
}
|
403
|
-
|
404
|
-
td {
|
405
|
-
padding: 0.3em;
|
406
|
-
}
|
407
|
-
|
408
|
-
td:first-child {
|
409
|
-
width: 190px;
|
410
|
-
}
|
411
|
-
|
412
|
-
td {
|
413
|
-
border-left: 1px solid #CCC;
|
414
|
-
text-align: center;
|
415
|
-
}
|
416
|
-
|
417
|
-
.method_name {
|
418
|
-
text-align: left;
|
419
|
-
}
|
420
|
-
|
421
|
-
tfoot td {
|
422
|
-
text-align: left;
|
423
|
-
}
|
424
|
-
</style>
|
425
|
-
</head>
|
426
|
-
<body>
|
427
|
-
<h1>Profile Report: <%= RubyProf.measure_mode_string %></h1>
|
428
|
-
<!-- Threads Table -->
|
429
|
-
<table>
|
430
|
-
<tr>
|
431
|
-
<th>Thread ID</th>
|
432
|
-
<th>Fiber ID</th>
|
433
|
-
<th>Total Time</th>
|
434
|
-
</tr>
|
435
|
-
<% for thread in @result.threads %>
|
436
|
-
<tr>
|
437
|
-
<td><%= thread.id %></td>
|
438
|
-
<td><a href="#<%= thread.fiber_id %>"><%= thread.fiber_id %></a></td>
|
439
|
-
<td><%= thread.total_time %></td>
|
440
|
-
</tr>
|
441
|
-
<% end %>
|
442
|
-
</table>
|
443
|
-
<!-- Methods Tables -->
|
444
|
-
<%
|
445
|
-
for thread in @result.threads
|
446
|
-
methods = thread.methods
|
447
|
-
total_time = thread.total_time
|
448
|
-
%>
|
449
|
-
<h2><a name="<%= thread.fiber_id %>">Thread <%= thread.id %>, Fiber: <%= thread.fiber_id %></a></h2>
|
450
|
-
<table>
|
451
|
-
<thead>
|
452
|
-
<tr>
|
453
|
-
<th>%Total</th>
|
454
|
-
<th>%Self</th>
|
455
|
-
<th>Total</th>
|
456
|
-
<th>Self</th>
|
457
|
-
<th>Wait</th>
|
458
|
-
<th>Child</th>
|
459
|
-
<th>Calls</th>
|
460
|
-
<th class="method_name">Name</th>
|
461
|
-
<th>Line</th>
|
462
|
-
</tr>
|
463
|
-
</thead>
|
464
|
-
<tbody>
|
465
|
-
<%
|
466
|
-
min_time = @options[:min_time] || (@options[:nonzero] ? 0.005 : nil)
|
467
|
-
methods.sort_by(&sort_method).reverse_each do |method|
|
468
|
-
total_percentage = (method.total_time/total_time) * 100
|
469
|
-
next if total_percentage < min_percent
|
470
|
-
next if min_time && method.total_time < min_time
|
471
|
-
self_percentage = (method.self_time/total_time) * 100
|
472
|
-
%>
|
473
|
-
<!-- Parents -->
|
474
|
-
<%
|
475
|
-
for caller in method.aggregate_parents.sort_by(&:total_time)
|
476
|
-
next unless caller.parent
|
477
|
-
next if min_time && caller.total_time < min_time
|
478
|
-
%>
|
479
|
-
<tr>
|
480
|
-
<td>&nbsp;</td>
|
481
|
-
<td>&nbsp;</td>
|
482
|
-
<td><%= sprintf("%.2f", caller.total_time) %></td>
|
483
|
-
<td><%= sprintf("%.2f", caller.self_time) %></td>
|
484
|
-
<td><%= sprintf("%.2f", caller.wait_time) %></td>
|
485
|
-
<td><%= sprintf("%.2f", caller.children_time) %></td>
|
486
|
-
<td><%= "#{caller.called}/#{method.called}" %></td>
|
487
|
-
<td class="method_name"><%= create_link(thread, total_time, caller.parent.target) %></td>
|
488
|
-
<td><%= file_link(caller.parent.target.source_file, caller.line) %></td>
|
489
|
-
</tr>
|
490
|
-
<% end %>
|
491
|
-
<tr class="method">
|
492
|
-
<td><%= sprintf("%.2f%%", total_percentage) %></td>
|
493
|
-
<td><%= sprintf("%.2f%%", self_percentage) %></td>
|
494
|
-
<td><%= sprintf("%.2f", method.total_time) %></td>
|
495
|
-
<td><%= sprintf("%.2f", method.self_time) %></td>
|
496
|
-
<td><%= sprintf("%.2f", method.wait_time) %></td>
|
497
|
-
<td><%= sprintf("%.2f", method.children_time) %></td>
|
498
|
-
<td><%= sprintf("%i", method.called) %></td>
|
499
|
-
<td class="method_name">
|
500
|
-
<a name="<%= method_href(thread, method) %>">
|
501
|
-
<%= method.recursive? ? "*" : " "%><%= h method.full_name %>
|
502
|
-
</a>
|
503
|
-
</td>
|
504
|
-
<td><%= file_link(method.source_file, method.line) %></td>
|
505
|
-
</tr>
|
506
|
-
<!-- Children -->
|
507
|
-
<%
|
508
|
-
for callee in method.aggregate_children.sort_by(&:total_time).reverse
|
509
|
-
next if min_time && callee.total_time < min_time
|
510
|
-
%>
|
511
|
-
<tr>
|
512
|
-
<td>&nbsp;</td>
|
513
|
-
<td>&nbsp;</td>
|
514
|
-
<td><%= sprintf("%.2f", callee.total_time) %></td>
|
515
|
-
<td><%= sprintf("%.2f", callee.self_time) %></td>
|
516
|
-
<td><%= sprintf("%.2f", callee.wait_time) %></td>
|
517
|
-
<td><%= sprintf("%.2f", callee.children_time) %></td>
|
518
|
-
<td><%= "#{callee.called}/#{callee.target.called}" %></td>
|
519
|
-
<td class="method_name"><%= create_link(thread, total_time, callee.target) %></td>
|
520
|
-
<td><%= file_link(method.source_file, callee.line) %></td>
|
521
|
-
</tr>
|
522
|
-
<% end %>
|
523
|
-
<!-- Create divider row -->
|
524
|
-
<tr class="break"><td colspan="9"></td></tr>
|
525
|
-
<% end %>
|
526
|
-
</tbody>
|
527
|
-
<tfoot>
|
528
|
-
<tr>
|
529
|
-
<td colspan="9">* indicates recursively called methods</td>
|
530
|
-
</tr>
|
531
|
-
</tfoot>
|
532
|
-
</table>
|
533
|
-
<% end %>
|
534
|
-
</body>
|
535
|
-
</html>'</span>
|
536
|
-
<span class="ruby-keyword">end</span></pre>
|
537
|
-
</div>
|
538
|
-
|
539
|
-
</div>
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
</div>
|
545
|
-
|
546
|
-
|
547
|
-
</section>
|
548
|
-
|
549
|
-
</section>
|
550
|
-
</main>
|
551
|
-
|
552
|
-
|
553
|
-
<footer id="validator-badges" role="contentinfo">
|
554
|
-
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
555
|
-
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
556
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
557
|
-
</footer>
|
558
|
-
|