ruby-prof 0.15.3 → 0.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES +9 -0
- data/README.rdoc +24 -39
- data/bin/ruby-prof +1 -2
- data/doc/created.rid +8 -8
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/ext/ruby_prof/rp_measure.c +20 -28
- data/ext/ruby_prof/rp_measure.h +6 -6
- data/ext/ruby_prof/rp_measure_allocations.c +9 -2
- data/ext/ruby_prof/rp_measure_memory.c +4 -0
- data/lib/ruby-prof.rb +9 -20
- data/lib/ruby-prof/compatibility.rb +12 -4
- data/lib/ruby-prof/printers/flat_printer.rb +1 -0
- data/lib/ruby-prof/version.rb +1 -1
- data/test/thread_test.rb +7 -4
- metadata +2 -54
- data/doc/LICENSE.html +0 -114
- data/doc/README_rdoc.html +0 -607
- data/doc/Rack.html +0 -95
- data/doc/Rack/RubyProf.html +0 -264
- data/doc/RubyProf.html +0 -965
- data/doc/RubyProf/AbstractPrinter.html +0 -546
- data/doc/RubyProf/AggregateCallInfo.html +0 -537
- data/doc/RubyProf/CallInfo.html +0 -468
- data/doc/RubyProf/CallInfoPrinter.html +0 -120
- data/doc/RubyProf/CallInfoVisitor.html +0 -200
- data/doc/RubyProf/CallStackPrinter.html +0 -1604
- data/doc/RubyProf/CallTreePrinter.html +0 -359
- data/doc/RubyProf/Cmd.html +0 -624
- data/doc/RubyProf/DotPrinter.html +0 -257
- data/doc/RubyProf/FlatPrinter.html +0 -163
- data/doc/RubyProf/FlatPrinterWithLineNumbers.html +0 -201
- data/doc/RubyProf/GraphHtmlPrinter.html +0 -575
- data/doc/RubyProf/GraphPrinter.html +0 -139
- data/doc/RubyProf/MethodInfo.html +0 -685
- data/doc/RubyProf/MultiPrinter.html +0 -358
- data/doc/RubyProf/Profile.html +0 -764
- data/doc/RubyProf/ProfileTask.html +0 -490
- data/doc/RubyProf/Thread.html +0 -199
- data/doc/examples/flat_txt.html +0 -149
- data/doc/examples/graph_html.html +0 -850
- data/doc/examples/graph_txt.html +0 -274
- 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/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 -633
- data/doc/table_of_contents.html +0 -859
@@ -1,575 +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
|
-
</script>
|
12
|
-
|
13
|
-
<script src="../js/jquery.js"></script>
|
14
|
-
<script src="../js/darkfish.js"></script>
|
15
|
-
|
16
|
-
<link href="../css/fonts.css" rel="stylesheet">
|
17
|
-
<link href="../css/rdoc.css" rel="stylesheet">
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
<body id="top" role="document" class="class">
|
22
|
-
<nav role="navigation">
|
23
|
-
<div id="project-navigation">
|
24
|
-
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
25
|
-
<h2>
|
26
|
-
<a href="../index.html" rel="home">Home</a>
|
27
|
-
</h2>
|
28
|
-
|
29
|
-
<div id="table-of-contents-navigation">
|
30
|
-
<a href="../table_of_contents.html#pages">Pages</a>
|
31
|
-
<a href="../table_of_contents.html#classes">Classes</a>
|
32
|
-
<a href="../table_of_contents.html#methods">Methods</a>
|
33
|
-
</div>
|
34
|
-
</div>
|
35
|
-
|
36
|
-
<div id="search-section" role="search" class="project-section initially-hidden">
|
37
|
-
<form action="#" method="get" accept-charset="utf-8">
|
38
|
-
<div id="search-field-wrapper">
|
39
|
-
<input id="search-field" role="combobox" aria-label="Search"
|
40
|
-
aria-autocomplete="list" aria-controls="search-results"
|
41
|
-
type="text" name="search" placeholder="Search" spellcheck="false"
|
42
|
-
title="Type to search, Up and Down to navigate, Enter to load">
|
43
|
-
</div>
|
44
|
-
|
45
|
-
<ul id="search-results" aria-label="Search Results"
|
46
|
-
aria-busy="false" aria-expanded="false"
|
47
|
-
aria-atomic="false" class="initially-hidden"></ul>
|
48
|
-
</form>
|
49
|
-
</div>
|
50
|
-
|
51
|
-
</div>
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
<div id="class-metadata">
|
56
|
-
|
57
|
-
<div id="parent-class-section" class="nav-section">
|
58
|
-
<h3>Parent</h3>
|
59
|
-
|
60
|
-
|
61
|
-
<p class="link"><a href="AbstractPrinter.html">RubyProf::AbstractPrinter</a>
|
62
|
-
|
63
|
-
</div>
|
64
|
-
|
65
|
-
<div id="includes-section" class="nav-section">
|
66
|
-
<h3>Included Modules</h3>
|
67
|
-
|
68
|
-
<ul class="link-list">
|
69
|
-
|
70
|
-
|
71
|
-
<li><span class="include">ERB::Util</span>
|
72
|
-
|
73
|
-
|
74
|
-
</ul>
|
75
|
-
</div>
|
76
|
-
|
77
|
-
|
78
|
-
<!-- Method Quickref -->
|
79
|
-
<div id="method-list-section" class="nav-section">
|
80
|
-
<h3>Methods</h3>
|
81
|
-
|
82
|
-
<ul class="link-list" role="directory">
|
83
|
-
|
84
|
-
<li ><a href="#method-i-create_link">#create_link</a>
|
85
|
-
|
86
|
-
<li ><a href="#method-i-file_link">#file_link</a>
|
87
|
-
|
88
|
-
<li ><a href="#method-i-method_href">#method_href</a>
|
89
|
-
|
90
|
-
<li ><a href="#method-i-print">#print</a>
|
91
|
-
|
92
|
-
<li class="calls-super" ><a href="#method-i-setup_options">#setup_options</a>
|
93
|
-
|
94
|
-
<li ><a href="#method-i-template">#template</a>
|
95
|
-
|
96
|
-
</ul>
|
97
|
-
</div>
|
98
|
-
|
99
|
-
</div>
|
100
|
-
</nav>
|
101
|
-
|
102
|
-
<main role="main" aria-labelledby="class-RubyProf::GraphHtmlPrinter">
|
103
|
-
<h1 id="class-RubyProf::GraphHtmlPrinter" class="class">
|
104
|
-
class RubyProf::GraphHtmlPrinter
|
105
|
-
</h1>
|
106
|
-
|
107
|
-
<section class="description">
|
108
|
-
|
109
|
-
<p>Generates <a href="../files/examples/graph_html.html">graph</a> profile
|
110
|
-
reports as html. To use the graph html printer:</p>
|
111
|
-
|
112
|
-
<pre>result = RubyProf.profile do
|
113
|
-
[code to profile]
|
114
|
-
end
|
115
|
-
|
116
|
-
printer = RubyProf::GraphHtmlPrinter.new(result)
|
117
|
-
printer.print(STDOUT, :min_percent=>0)</pre>
|
118
|
-
|
119
|
-
<p>The Graph printer takes the following options in its print methods:</p>
|
120
|
-
|
121
|
-
<pre>:filename - specify a file to use that contains the ERB
|
122
|
-
template to use, instead of the built-in self.template
|
123
|
-
|
124
|
-
:template - specify an ERB template to use, instead of the
|
125
|
-
built-in self.template</pre>
|
126
|
-
|
127
|
-
</section>
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
<section class="constants-list">
|
139
|
-
<header>
|
140
|
-
<h3>Constants</h3>
|
141
|
-
</header>
|
142
|
-
<dl>
|
143
|
-
|
144
|
-
<dt id="CALL_WIDTH">CALL_WIDTH
|
145
|
-
|
146
|
-
<dd>
|
147
|
-
|
148
|
-
|
149
|
-
<dt id="PERCENTAGE_WIDTH">PERCENTAGE_WIDTH
|
150
|
-
|
151
|
-
<dd>
|
152
|
-
|
153
|
-
|
154
|
-
<dt id="TIME_WIDTH">TIME_WIDTH
|
155
|
-
|
156
|
-
<dd>
|
157
|
-
|
158
|
-
|
159
|
-
</dl>
|
160
|
-
</section>
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
167
|
-
<header>
|
168
|
-
<h3>Public Instance Methods</h3>
|
169
|
-
</header>
|
170
|
-
|
171
|
-
|
172
|
-
<div id="method-i-create_link" class="method-detail ">
|
173
|
-
|
174
|
-
<div class="method-heading">
|
175
|
-
<span class="method-name">create_link</span><span
|
176
|
-
class="method-args">(thread, overall_time, method)</span>
|
177
|
-
|
178
|
-
<span class="method-click-advice">click to toggle source</span>
|
179
|
-
|
180
|
-
</div>
|
181
|
-
|
182
|
-
|
183
|
-
<div class="method-description">
|
184
|
-
|
185
|
-
<p>Creates a link to a method. Note that we do not create links to methods
|
186
|
-
which are under the min_perecent specified by the user, since they will not
|
187
|
-
be printed out.</p>
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
<div class="method-source-code" id="create_link-source">
|
193
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 49</span>
|
194
|
-
<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>)
|
195
|
-
<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>
|
196
|
-
<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>
|
197
|
-
<span class="ruby-comment"># Just return name</span>
|
198
|
-
<span class="ruby-identifier">h</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">full_name</span>
|
199
|
-
<span class="ruby-keyword">else</span>
|
200
|
-
<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>)
|
201
|
-
<span class="ruby-node">"<a href=\"#{href}\">#{h method.full_name}</a>"</span>
|
202
|
-
<span class="ruby-keyword">end</span>
|
203
|
-
<span class="ruby-keyword">end</span></pre>
|
204
|
-
</div>
|
205
|
-
|
206
|
-
</div>
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
</div>
|
212
|
-
|
213
|
-
|
214
|
-
<div id="method-i-file_link" class="method-detail ">
|
215
|
-
|
216
|
-
<div class="method-heading">
|
217
|
-
<span class="method-name">file_link</span><span
|
218
|
-
class="method-args">(path, linenum)</span>
|
219
|
-
|
220
|
-
<span class="method-click-advice">click to toggle source</span>
|
221
|
-
|
222
|
-
</div>
|
223
|
-
|
224
|
-
|
225
|
-
<div class="method-description">
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
<div class="method-source-code" id="file_link-source">
|
233
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 64</span>
|
234
|
-
<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>)
|
235
|
-
<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>)
|
236
|
-
<span class="ruby-keyword">if</span> <span class="ruby-identifier">srcfile</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/\/ruby_runtime$/</span>
|
237
|
-
<span class="ruby-string">""</span>
|
238
|
-
<span class="ruby-keyword">else</span>
|
239
|
-
<span class="ruby-keyword">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/darwin/</span>
|
240
|
-
<span class="ruby-node">"<a href=\"txmt://open?url=file://#{h srcfile}&line=#{linenum}\" title=\"#{h srcfile}:#{linenum}\">#{linenum}</a>"</span>
|
241
|
-
<span class="ruby-keyword">else</span>
|
242
|
-
<span class="ruby-node">"<a href=\"file://#{h srcfile}##{linenum}\" title=\"#{h srcfile}:#{linenum}\">#{linenum}</a>"</span>
|
243
|
-
<span class="ruby-keyword">end</span>
|
244
|
-
<span class="ruby-keyword">end</span>
|
245
|
-
<span class="ruby-keyword">end</span></pre>
|
246
|
-
</div>
|
247
|
-
|
248
|
-
</div>
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
</div>
|
254
|
-
|
255
|
-
|
256
|
-
<div id="method-i-method_href" class="method-detail ">
|
257
|
-
|
258
|
-
<div class="method-heading">
|
259
|
-
<span class="method-name">method_href</span><span
|
260
|
-
class="method-args">(thread, method)</span>
|
261
|
-
|
262
|
-
<span class="method-click-advice">click to toggle source</span>
|
263
|
-
|
264
|
-
</div>
|
265
|
-
|
266
|
-
|
267
|
-
<div class="method-description">
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
<div class="method-source-code" id="method_href-source">
|
275
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 60</span>
|
276
|
-
<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>)
|
277
|
-
<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>)
|
278
|
-
<span class="ruby-keyword">end</span></pre>
|
279
|
-
</div>
|
280
|
-
|
281
|
-
</div>
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
</div>
|
287
|
-
|
288
|
-
|
289
|
-
<div id="method-i-print" class="method-detail ">
|
290
|
-
|
291
|
-
<div class="method-heading">
|
292
|
-
<span class="method-name">print</span><span
|
293
|
-
class="method-args">(output = STDOUT, options = {})</span>
|
294
|
-
|
295
|
-
<span class="method-click-advice">click to toggle source</span>
|
296
|
-
|
297
|
-
</div>
|
298
|
-
|
299
|
-
|
300
|
-
<div class="method-description">
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
<div class="method-source-code" id="print-source">
|
308
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 39</span>
|
309
|
-
<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> = {})
|
310
|
-
<span class="ruby-ivar">@output</span> = <span class="ruby-identifier">output</span>
|
311
|
-
<span class="ruby-identifier">setup_options</span>(<span class="ruby-identifier">options</span>)
|
312
|
-
<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>)
|
313
|
-
<span class="ruby-keyword">end</span></pre>
|
314
|
-
</div>
|
315
|
-
|
316
|
-
</div>
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
</div>
|
322
|
-
|
323
|
-
|
324
|
-
<div id="method-i-setup_options" class="method-detail ">
|
325
|
-
|
326
|
-
<div class="method-heading">
|
327
|
-
<span class="method-name">setup_options</span><span
|
328
|
-
class="method-args">(options)</span>
|
329
|
-
|
330
|
-
<span class="method-click-advice">click to toggle source</span>
|
331
|
-
|
332
|
-
</div>
|
333
|
-
|
334
|
-
|
335
|
-
<div class="method-description">
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
<div class="method-calls-super">
|
341
|
-
Calls superclass method
|
342
|
-
<a href="AbstractPrinter.html#method-i-setup_options">RubyProf::AbstractPrinter#setup_options</a>
|
343
|
-
</div>
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
<div class="method-source-code" id="setup_options-source">
|
348
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 30</span>
|
349
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">setup_options</span>(<span class="ruby-identifier">options</span>)
|
350
|
-
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">options</span>)
|
351
|
-
|
352
|
-
<span class="ruby-identifier">filename</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:filename</span>]
|
353
|
-
<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>)
|
354
|
-
<span class="ruby-ivar">@erb</span> = <span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">template</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>)
|
355
|
-
<span class="ruby-ivar">@erb</span>.<span class="ruby-identifier">filename</span> = <span class="ruby-identifier">filename</span>
|
356
|
-
<span class="ruby-keyword">end</span></pre>
|
357
|
-
</div>
|
358
|
-
|
359
|
-
</div>
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
</div>
|
365
|
-
|
366
|
-
|
367
|
-
<div id="method-i-template" class="method-detail ">
|
368
|
-
|
369
|
-
<div class="method-heading">
|
370
|
-
<span class="method-name">template</span><span
|
371
|
-
class="method-args">()</span>
|
372
|
-
|
373
|
-
<span class="method-click-advice">click to toggle source</span>
|
374
|
-
|
375
|
-
</div>
|
376
|
-
|
377
|
-
|
378
|
-
<div class="method-description">
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
<div class="method-source-code" id="template-source">
|
386
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 77</span>
|
387
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">template</span>
|
388
|
-
<span class="ruby-string">'
|
389
|
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
390
|
-
<html>
|
391
|
-
<head>
|
392
|
-
<style media="all" type="text/css">
|
393
|
-
table {
|
394
|
-
border-collapse: collapse;
|
395
|
-
border: 1px solid #CCC;
|
396
|
-
font-family: Verdana, Arial, Helvetica, sans-serif;
|
397
|
-
font-size: 9pt;
|
398
|
-
line-height: normal;
|
399
|
-
width: 100%;
|
400
|
-
}
|
401
|
-
|
402
|
-
th {
|
403
|
-
text-align: center;
|
404
|
-
border-top: 1px solid #FB7A31;
|
405
|
-
border-bottom: 1px solid #FB7A31;
|
406
|
-
background: #FFC;
|
407
|
-
padding: 0.3em;
|
408
|
-
border-left: 1px solid silver;
|
409
|
-
}
|
410
|
-
|
411
|
-
tr.break td {
|
412
|
-
border: 0;
|
413
|
-
border-top: 1px solid #FB7A31;
|
414
|
-
padding: 0;
|
415
|
-
margin: 0;
|
416
|
-
}
|
417
|
-
|
418
|
-
tr.method td {
|
419
|
-
font-weight: bold;
|
420
|
-
}
|
421
|
-
|
422
|
-
td {
|
423
|
-
padding: 0.3em;
|
424
|
-
}
|
425
|
-
|
426
|
-
td:first-child {
|
427
|
-
width: 190px;
|
428
|
-
}
|
429
|
-
|
430
|
-
td {
|
431
|
-
border-left: 1px solid #CCC;
|
432
|
-
text-align: center;
|
433
|
-
}
|
434
|
-
|
435
|
-
.method_name {
|
436
|
-
text-align: left;
|
437
|
-
}
|
438
|
-
|
439
|
-
tfoot td {
|
440
|
-
text-align: left;
|
441
|
-
}
|
442
|
-
</style>
|
443
|
-
</head>
|
444
|
-
<body>
|
445
|
-
<h1>Profile Report</h1>
|
446
|
-
<!-- Threads Table -->
|
447
|
-
<table>
|
448
|
-
<tr>
|
449
|
-
<th>Thread ID</th>
|
450
|
-
<th>Fiber ID</th>
|
451
|
-
<th>Total Time</th>
|
452
|
-
</tr>
|
453
|
-
<% for thread in @result.threads %>
|
454
|
-
<tr>
|
455
|
-
<td><%= thread.id %></td>
|
456
|
-
<td><a href="#<%= thread.fiber_id %>"><%= thread.fiber_id %></a></td>
|
457
|
-
<td><%= thread.total_time %></td>
|
458
|
-
</tr>
|
459
|
-
<% end %>
|
460
|
-
</table>
|
461
|
-
|
462
|
-
<!-- Methods Tables -->
|
463
|
-
<% for thread in @result.threads
|
464
|
-
methods = thread.methods
|
465
|
-
total_time = thread.total_time %>
|
466
|
-
<h2><a name="<%= thread.fiber_id %>">Thread <%= thread.id %>, Fiber: <%= thread.fiber_id %></a></h2>
|
467
|
-
<table>
|
468
|
-
<thead>
|
469
|
-
<tr>
|
470
|
-
<th><%= sprintf("%#{PERCENTAGE_WIDTH}s", "%Total") %></th>
|
471
|
-
<th><%= sprintf("%#{PERCENTAGE_WIDTH}s", "%Self") %></th>
|
472
|
-
<th><%= sprintf("%#{TIME_WIDTH}s", "Total") %></th>
|
473
|
-
<th><%= sprintf("%#{TIME_WIDTH}s", "Self") %></th>
|
474
|
-
<th><%= sprintf("%#{TIME_WIDTH}s", "Wait") %></th>
|
475
|
-
<th><%= sprintf("%#{TIME_WIDTH+2}s", "Child") %></th>
|
476
|
-
<th><%= sprintf("%#{CALL_WIDTH}s", "Calls") %></th>
|
477
|
-
<th class="method_name">Name</th>
|
478
|
-
<th>Line</th>
|
479
|
-
</tr>
|
480
|
-
</thead>
|
481
|
-
|
482
|
-
<tbody>
|
483
|
-
<% min_time = @options[:min_time] || (@options[:nonzero] ? 0.005 : nil)
|
484
|
-
methods.sort_by(&sort_method).reverse_each do |method|
|
485
|
-
total_percentage = (method.total_time/total_time) * 100
|
486
|
-
next if total_percentage < min_percent
|
487
|
-
next if min_time && method.total_time < min_time
|
488
|
-
self_percentage = (method.self_time/total_time) * 100 %>
|
489
|
-
|
490
|
-
<!-- Parents -->
|
491
|
-
<% for caller in method.aggregate_parents.sort_by(&:total_time)
|
492
|
-
next unless caller.parent
|
493
|
-
next if min_time && caller.total_time < min_time %>
|
494
|
-
<tr>
|
495
|
-
<td>&nbsp;</td>
|
496
|
-
<td>&nbsp;</td>
|
497
|
-
<td><%= sprintf("%#{TIME_WIDTH}.2f", caller.total_time) %></td>
|
498
|
-
<td><%= sprintf("%#{TIME_WIDTH}.2f", caller.self_time) %></td>
|
499
|
-
<td><%= sprintf("%#{TIME_WIDTH}.2f", caller.wait_time) %></td>
|
500
|
-
<td><%= sprintf("%#{TIME_WIDTH}.2f", caller.children_time) %></td>
|
501
|
-
<% called = "#{caller.called}/#{method.called}" %>
|
502
|
-
<td><%= sprintf("%#{CALL_WIDTH}s", called) %></td>
|
503
|
-
<td class="method_name"><%= create_link(thread, total_time, caller.parent.target) %></td>
|
504
|
-
<td><%= file_link(caller.parent.target.source_file, caller.line) %></td>
|
505
|
-
</tr>
|
506
|
-
<% end %>
|
507
|
-
|
508
|
-
<tr class="method">
|
509
|
-
<td><%= sprintf("%#{PERCENTAGE_WIDTH-1}.2f\%", total_percentage) %></td>
|
510
|
-
<td><%= sprintf("%#{PERCENTAGE_WIDTH-1}.2f\%", self_percentage) %></td>
|
511
|
-
<td><%= sprintf("%#{TIME_WIDTH}.2f", method.total_time) %></td>
|
512
|
-
<td><%= sprintf("%#{TIME_WIDTH}.2f", method.self_time) %></td>
|
513
|
-
<td><%= sprintf("%#{TIME_WIDTH}.2f", method.wait_time) %></td>
|
514
|
-
<td><%= sprintf("%#{TIME_WIDTH}.2f", method.children_time) %></td>
|
515
|
-
<td><%= sprintf("%#{CALL_WIDTH}i", method.called) %></td>
|
516
|
-
<td class="method_name">
|
517
|
-
<a name="<%= method_href(thread, method) %>">
|
518
|
-
<%= method.recursive? ? "*" : " "%><%= h method.full_name %>
|
519
|
-
</a>
|
520
|
-
</td>
|
521
|
-
<td><%= file_link(method.source_file, method.line) %></td>
|
522
|
-
</tr>
|
523
|
-
|
524
|
-
<!-- Children -->
|
525
|
-
<% for callee in method.aggregate_children.sort_by(&:total_time).reverse %>
|
526
|
-
<% next if min_time && callee.total_time < min_time %>
|
527
|
-
<tr>
|
528
|
-
<td>&nbsp;</td>
|
529
|
-
<td>&nbsp;</td>
|
530
|
-
<td><%= sprintf("%#{TIME_WIDTH}.2f", callee.total_time) %></td>
|
531
|
-
<td><%= sprintf("%#{TIME_WIDTH}.2f", callee.self_time) %></td>
|
532
|
-
<td><%= sprintf("%#{TIME_WIDTH}.2f", callee.wait_time) %></td>
|
533
|
-
<td><%= sprintf("%#{TIME_WIDTH}.2f", callee.children_time) %></td>
|
534
|
-
<% called = "#{callee.called}/#{callee.target.called}" %>
|
535
|
-
<td><%= sprintf("%#{CALL_WIDTH}s", called) %></td>
|
536
|
-
<td class="method_name"><%= create_link(thread, total_time, callee.target) %></td>
|
537
|
-
<td><%= file_link(method.source_file, callee.line) %></td>
|
538
|
-
</tr>
|
539
|
-
<% end %>
|
540
|
-
<!-- Create divider row -->
|
541
|
-
<tr class="break"><td colspan="9"></td></tr>
|
542
|
-
<% end %>
|
543
|
-
</tbody>
|
544
|
-
<tfoot>
|
545
|
-
<tr>
|
546
|
-
<td colspan="9">* indicates recursively called methods</td>
|
547
|
-
</tr>
|
548
|
-
</tfoot>
|
549
|
-
</table>
|
550
|
-
<% end %>
|
551
|
-
</body>
|
552
|
-
</html>'</span>
|
553
|
-
<span class="ruby-keyword">end</span></pre>
|
554
|
-
</div>
|
555
|
-
|
556
|
-
</div>
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
</div>
|
562
|
-
|
563
|
-
|
564
|
-
</section>
|
565
|
-
|
566
|
-
</section>
|
567
|
-
</main>
|
568
|
-
|
569
|
-
|
570
|
-
<footer id="validator-badges" role="contentinfo">
|
571
|
-
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
572
|
-
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
|
573
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
574
|
-
</footer>
|
575
|
-
|