ruby-prof 0.15.8 → 0.15.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +5 -0
- data/README.rdoc +187 -185
- data/doc/LICENSE.html +114 -0
- data/doc/README_rdoc.html +544 -0
- data/doc/Rack.html +95 -0
- data/doc/Rack/RubyProf.html +223 -0
- data/doc/RubyProf.html +961 -0
- data/doc/RubyProf/AbstractPrinter.html +546 -0
- data/doc/RubyProf/AggregateCallInfo.html +551 -0
- data/doc/RubyProf/CallInfo.html +639 -0
- data/doc/RubyProf/CallInfoPrinter.html +120 -0
- data/doc/RubyProf/CallInfoVisitor.html +198 -0
- data/doc/RubyProf/CallStackPrinter.html +1121 -0
- data/doc/RubyProf/CallTreePrinter.html +359 -0
- data/doc/RubyProf/Cmd.html +631 -0
- data/doc/RubyProf/DotPrinter.html +257 -0
- data/doc/RubyProf/FlatPrinter.html +163 -0
- data/doc/RubyProf/FlatPrinterWithLineNumbers.html +208 -0
- data/doc/RubyProf/GraphHtmlPrinter.html +552 -0
- data/doc/RubyProf/GraphPrinter.html +139 -0
- data/doc/RubyProf/MethodInfo.html +745 -0
- data/doc/RubyProf/MultiPrinter.html +358 -0
- data/doc/RubyProf/Profile.html +713 -0
- data/doc/RubyProf/ProfileTask.html +490 -0
- data/doc/RubyProf/Thread.html +268 -0
- data/doc/created.rid +13 -13
- data/doc/examples/flat_txt.html +138 -0
- data/doc/examples/graph_html.html +909 -0
- data/doc/examples/graph_txt.html +247 -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/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 +571 -0
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +893 -0
- data/examples/flat.txt +50 -55
- data/examples/graph.html +823 -823
- data/examples/graph.txt +139 -170
- data/ext/ruby_prof/extconf.rb +6 -1
- data/lib/ruby-prof/aggregate_call_info.rb +17 -11
- data/lib/ruby-prof/call_info.rb +2 -17
- data/lib/ruby-prof/method_info.rb +6 -22
- data/lib/ruby-prof/printers/graph_html_printer.rb +0 -2
- data/lib/ruby-prof/printers/graph_printer.rb +4 -6
- data/lib/ruby-prof/rack.rb +7 -0
- data/lib/ruby-prof/thread.rb +0 -4
- data/lib/ruby-prof/version.rb +1 -1
- data/ruby-prof.gemspec +1 -1
- data/test/basic_test.rb +26 -26
- data/test/issue137_test.rb +63 -0
- data/test/measure_allocations_test.rb +4 -3
- data/test/measure_cpu_time_test.rb +6 -6
- data/test/measure_process_time_test.rb +8 -8
- data/test/pause_resume_test.rb +9 -9
- data/test/printers_test.rb +1 -1
- data/test/printing_recursive_graph_test.rb +127 -0
- data/test/rack_test.rb +49 -1
- data/test/recursive_test.rb +41 -37
- data/test/test_helper.rb +93 -0
- metadata +59 -5
@@ -0,0 +1,268 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class RubyProf::Thread - 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">Object
|
62
|
+
|
63
|
+
</div>
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<div id="method-list-section" class="nav-section">
|
69
|
+
<h3>Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list" role="directory">
|
72
|
+
|
73
|
+
<li ><a href="#method-i-detect_recursion">#detect_recursion</a>
|
74
|
+
|
75
|
+
<li ><a href="#method-i-top_call_infos">#top_call_infos</a>
|
76
|
+
|
77
|
+
<li ><a href="#method-i-top_methods">#top_methods</a>
|
78
|
+
|
79
|
+
<li ><a href="#method-i-total_time">#total_time</a>
|
80
|
+
|
81
|
+
</ul>
|
82
|
+
</div>
|
83
|
+
|
84
|
+
</div>
|
85
|
+
</nav>
|
86
|
+
|
87
|
+
<main role="main" aria-labelledby="class-RubyProf::Thread">
|
88
|
+
<h1 id="class-RubyProf::Thread" class="class">
|
89
|
+
class RubyProf::Thread
|
90
|
+
</h1>
|
91
|
+
|
92
|
+
<section class="description">
|
93
|
+
|
94
|
+
</section>
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
110
|
+
<header>
|
111
|
+
<h3>Public Instance Methods</h3>
|
112
|
+
</header>
|
113
|
+
|
114
|
+
|
115
|
+
<div id="method-i-detect_recursion" class="method-detail ">
|
116
|
+
|
117
|
+
<div class="method-heading">
|
118
|
+
<span class="method-name">detect_recursion</span><span
|
119
|
+
class="method-args">()</span>
|
120
|
+
|
121
|
+
<span class="method-click-advice">click to toggle source</span>
|
122
|
+
|
123
|
+
</div>
|
124
|
+
|
125
|
+
|
126
|
+
<div class="method-description">
|
127
|
+
|
128
|
+
<p>This method detect recursive calls in the call tree of a given thread It
|
129
|
+
should be called only once for each thread</p>
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
<div class="method-source-code" id="detect_recursion-source">
|
135
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/thread.rb, line 15</span>
|
136
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">detect_recursion</span>
|
137
|
+
<span class="ruby-identifier">top_call_infos</span>.<span class="ruby-identifier">each</span>(<span class="ruby-operator">&</span><span class="ruby-value">:detect_recursion</span>)
|
138
|
+
<span class="ruby-keyword">end</span></pre>
|
139
|
+
</div>
|
140
|
+
|
141
|
+
</div>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
</div>
|
147
|
+
|
148
|
+
|
149
|
+
<div id="method-i-top_call_infos" class="method-detail ">
|
150
|
+
|
151
|
+
<div class="method-heading">
|
152
|
+
<span class="method-name">top_call_infos</span><span
|
153
|
+
class="method-args">()</span>
|
154
|
+
|
155
|
+
<span class="method-click-advice">click to toggle source</span>
|
156
|
+
|
157
|
+
</div>
|
158
|
+
|
159
|
+
|
160
|
+
<div class="method-description">
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
<div class="method-source-code" id="top_call_infos-source">
|
168
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/thread.rb, line 9</span>
|
169
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">top_call_infos</span>
|
170
|
+
<span class="ruby-identifier">top_methods</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&</span><span class="ruby-value">:call_infos</span>).<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">select</span>(<span class="ruby-operator">&</span><span class="ruby-value">:root?</span>)
|
171
|
+
<span class="ruby-keyword">end</span></pre>
|
172
|
+
</div>
|
173
|
+
|
174
|
+
</div>
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
</div>
|
180
|
+
|
181
|
+
|
182
|
+
<div id="method-i-top_methods" class="method-detail ">
|
183
|
+
|
184
|
+
<div class="method-heading">
|
185
|
+
<span class="method-name">top_methods</span><span
|
186
|
+
class="method-args">()</span>
|
187
|
+
|
188
|
+
<span class="method-click-advice">click to toggle source</span>
|
189
|
+
|
190
|
+
</div>
|
191
|
+
|
192
|
+
|
193
|
+
<div class="method-description">
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
<div class="method-source-code" id="top_methods-source">
|
201
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/thread.rb, line 3</span>
|
202
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">top_methods</span>
|
203
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">methods</span>.<span class="ruby-identifier">select</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">method_info</span><span class="ruby-operator">|</span>
|
204
|
+
<span class="ruby-identifier">method_info</span>.<span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">detect</span>(<span class="ruby-operator">&</span><span class="ruby-value">:root?</span>)
|
205
|
+
<span class="ruby-keyword">end</span>
|
206
|
+
<span class="ruby-keyword">end</span></pre>
|
207
|
+
</div>
|
208
|
+
|
209
|
+
</div>
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
</div>
|
215
|
+
|
216
|
+
|
217
|
+
<div id="method-i-total_time" class="method-detail ">
|
218
|
+
|
219
|
+
<div class="method-heading">
|
220
|
+
<span class="method-name">total_time</span><span
|
221
|
+
class="method-args">()</span>
|
222
|
+
|
223
|
+
<span class="method-click-advice">click to toggle source</span>
|
224
|
+
|
225
|
+
</div>
|
226
|
+
|
227
|
+
|
228
|
+
<div class="method-description">
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
<div class="method-source-code" id="total_time-source">
|
236
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/thread.rb, line 19</span>
|
237
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">total_time</span>
|
238
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">top_methods</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">method_info</span><span class="ruby-operator">|</span>
|
239
|
+
<span class="ruby-identifier">method_info</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">call_info</span><span class="ruby-operator">|</span>
|
240
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">nil?</span>
|
241
|
+
<span class="ruby-identifier">sum</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">total_time</span>
|
242
|
+
<span class="ruby-keyword">end</span>
|
243
|
+
<span class="ruby-keyword">end</span>
|
244
|
+
<span class="ruby-identifier">sum</span>
|
245
|
+
<span class="ruby-keyword">end</span>
|
246
|
+
<span class="ruby-keyword">end</span></pre>
|
247
|
+
</div>
|
248
|
+
|
249
|
+
</div>
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
</div>
|
255
|
+
|
256
|
+
|
257
|
+
</section>
|
258
|
+
|
259
|
+
</section>
|
260
|
+
</main>
|
261
|
+
|
262
|
+
|
263
|
+
<footer id="validator-badges" role="contentinfo">
|
264
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
265
|
+
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
|
266
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
267
|
+
</footer>
|
268
|
+
|
data/doc/created.rid
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
|
1
|
+
Wed, 09 Dec 2015 17:40:38 +0100
|
2
2
|
bin/ruby-prof Sun, 22 Feb 2015 15:41:38 +0100
|
3
3
|
bin/ruby-prof-check-trace Sun, 10 Mar 2013 10:57:14 +0100
|
4
|
-
examples/flat.txt
|
5
|
-
examples/graph.txt
|
6
|
-
examples/graph.html
|
4
|
+
examples/flat.txt Sun, 06 Dec 2015 14:08:42 +0100
|
5
|
+
examples/graph.txt Wed, 09 Dec 2015 15:28:08 +0100
|
6
|
+
examples/graph.html Wed, 09 Dec 2015 16:14:34 +0100
|
7
7
|
lib/ruby-prof.rb Sat, 14 Feb 2015 13:03:02 +0100
|
8
|
-
lib/ruby-prof/aggregate_call_info.rb
|
9
|
-
lib/ruby-prof/call_info.rb
|
8
|
+
lib/ruby-prof/aggregate_call_info.rb Tue, 08 Dec 2015 18:03:49 +0100
|
9
|
+
lib/ruby-prof/call_info.rb Tue, 08 Dec 2015 17:38:56 +0100
|
10
10
|
lib/ruby-prof/call_info_visitor.rb Sun, 22 Feb 2015 16:10:12 +0100
|
11
11
|
lib/ruby-prof/compatibility.rb Sat, 14 Feb 2015 13:02:38 +0100
|
12
|
-
lib/ruby-prof/method_info.rb
|
12
|
+
lib/ruby-prof/method_info.rb Tue, 08 Dec 2015 18:03:25 +0100
|
13
13
|
lib/ruby-prof/printers/abstract_printer.rb Tue, 29 Jan 2013 16:43:39 +0100
|
14
14
|
lib/ruby-prof/printers/call_info_printer.rb Sun, 22 Feb 2015 16:10:12 +0100
|
15
15
|
lib/ruby-prof/printers/call_stack_printer.rb Thu, 23 Apr 2015 12:17:56 +0200
|
@@ -17,15 +17,15 @@ lib/ruby-prof/printers/call_tree_printer.rb Tue, 29 Jan 2013 16:43:39 +0100
|
|
17
17
|
lib/ruby-prof/printers/dot_printer.rb Sun, 22 Feb 2015 16:10:12 +0100
|
18
18
|
lib/ruby-prof/printers/flat_printer.rb Fri, 24 Apr 2015 08:23:15 +0200
|
19
19
|
lib/ruby-prof/printers/flat_printer_with_line_numbers.rb Sun, 15 Feb 2015 12:21:36 +0100
|
20
|
-
lib/ruby-prof/printers/graph_html_printer.rb
|
21
|
-
lib/ruby-prof/printers/graph_printer.rb
|
20
|
+
lib/ruby-prof/printers/graph_html_printer.rb Tue, 08 Dec 2015 17:40:05 +0100
|
21
|
+
lib/ruby-prof/printers/graph_printer.rb Wed, 09 Dec 2015 15:31:08 +0100
|
22
22
|
lib/ruby-prof/printers/multi_printer.rb Tue, 29 Jan 2013 16:43:39 +0100
|
23
23
|
lib/ruby-prof/profile.rb Sun, 22 Feb 2015 16:10:12 +0100
|
24
|
-
lib/ruby-prof/rack.rb
|
24
|
+
lib/ruby-prof/rack.rb Sun, 06 Dec 2015 14:17:01 +0100
|
25
25
|
lib/ruby-prof/task.rb Tue, 29 Jan 2013 16:43:39 +0100
|
26
|
-
lib/ruby-prof/thread.rb
|
27
|
-
lib/ruby-prof/version.rb
|
26
|
+
lib/ruby-prof/thread.rb Tue, 08 Dec 2015 17:40:21 +0100
|
27
|
+
lib/ruby-prof/version.rb Wed, 09 Dec 2015 17:22:29 +0100
|
28
28
|
lib/unprof.rb Tue, 29 Jan 2013 16:43:39 +0100
|
29
29
|
ext/ruby_prof/ruby_prof.c Sat, 14 Feb 2015 12:36:01 +0100
|
30
|
-
README.rdoc
|
30
|
+
README.rdoc Mon, 07 Dec 2015 21:01:22 +0100
|
31
31
|
LICENSE Tue, 20 May 2014 07:16:27 +0200
|
@@ -0,0 +1,138 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>flat - 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="file">
|
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="project-metadata">
|
56
|
+
<div id="fileindex-section" class="nav-section">
|
57
|
+
<h3>Pages</h3>
|
58
|
+
|
59
|
+
<ul class="link-list">
|
60
|
+
|
61
|
+
<li><a href="../LICENSE.html">LICENSE</a>
|
62
|
+
|
63
|
+
<li><a href="../README_rdoc.html">README</a>
|
64
|
+
|
65
|
+
<li><a href="../examples/flat_txt.html">flat</a>
|
66
|
+
|
67
|
+
<li><a href="../examples/graph_html.html">graph.html</a>
|
68
|
+
|
69
|
+
<li><a href="../examples/graph_txt.html">graph</a>
|
70
|
+
|
71
|
+
</ul>
|
72
|
+
</div>
|
73
|
+
|
74
|
+
</div>
|
75
|
+
</nav>
|
76
|
+
|
77
|
+
<main role="main" aria-label="Page examples/flat.txt">
|
78
|
+
|
79
|
+
<h1 id="label-Flat+Profiles">Flat Profiles<span><a href="#label-Flat+Profiles">¶</a> <a href="#top">↑</a></span></h1>
|
80
|
+
|
81
|
+
<p>Flat profiles show the total amount of time spent in each method. As an
|
82
|
+
example, here is the output from running printers_test.rb.</p>
|
83
|
+
|
84
|
+
<p>Measure Mode: wall_time Thread ID: 70355159212340 Fiber ID: 70355171633140
|
85
|
+
Total: 0.060485 Sort by: self_time</p>
|
86
|
+
|
87
|
+
<pre>%self total self wait child calls name
|
88
|
+
97.07 0.059 0.059 0.000 0.000 1001 Integer#upto
|
89
|
+
0.92 0.059 0.001 0.000 0.059 1000 Object#is_prime
|
90
|
+
0.66 0.060 0.000 0.000 0.059 1 Array#select
|
91
|
+
0.59 0.000 0.000 0.000 0.000 1000 Kernel#rand
|
92
|
+
0.50 0.001 0.000 0.000 0.000 1 Array#each_index
|
93
|
+
0.20 0.000 0.000 0.000 0.000 1000 Kernel#respond_to_missing?
|
94
|
+
0.01 0.000 0.000 0.000 0.000 1 Object#find_largest
|
95
|
+
0.01 0.060 0.000 0.000 0.060 1 PrintersTest#setup
|
96
|
+
0.01 0.060 0.000 0.000 0.060 1 Object#find_primes
|
97
|
+
0.01 0.000 0.000 0.000 0.000 1 Class#new
|
98
|
+
0.01 0.060 0.000 0.000 0.060 1 Object#run_primes
|
99
|
+
0.00 0.000 0.000 0.000 0.000 1 Array#first
|
100
|
+
0.00 0.001 0.000 0.000 0.001 1 Object#make_random_array
|
101
|
+
0.00 0.000 0.000 0.000 0.000 1 Array#initialize</pre>
|
102
|
+
|
103
|
+
<p>All values are in seconds.</p>
|
104
|
+
|
105
|
+
<p>The columns are:</p>
|
106
|
+
|
107
|
+
<pre>%self - The percentage of time spent in this method, derived from self_time/total_time
|
108
|
+
total - The time spent in this method and its children.
|
109
|
+
self - The time spent in this method.
|
110
|
+
wait - amount of time this method waited for other threads
|
111
|
+
child - The time spent in this method's children.
|
112
|
+
calls - The number of times this method was called.
|
113
|
+
name - The name of the method.</pre>
|
114
|
+
|
115
|
+
<p>Methods are sorted based on %self, therefore the methods that execute the
|
116
|
+
longest are listed first.</p>
|
117
|
+
|
118
|
+
<p>For example, wee can see that Integer#upto took the most time, 0.059
|
119
|
+
seconds. Method Object#is_prime calls this method, so the 0.59 seconds
|
120
|
+
appear as child time for Object#is_prime.</p>
|
121
|
+
|
122
|
+
<p>The interpretation of method names is:</p>
|
123
|
+
<ul><li>
|
124
|
+
<p>MyObject#test - An instance method “test” of the class “MyObject”</p>
|
125
|
+
</li><li>
|
126
|
+
<p><Object:MyObject>#test - The <> characters indicate a singleton
|
127
|
+
method on a singleton class.</p>
|
128
|
+
</li></ul>
|
129
|
+
</main>
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<footer id="validator-badges" role="contentinfo">
|
134
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
135
|
+
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
|
136
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
137
|
+
</footer>
|
138
|
+
|