ruby-prof 0.15.7 → 0.15.8
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/doc/created.rid +4 -4
- data/doc/js/search_index.js.gz +0 -0
- data/examples/graph.dot +53 -75
- data/examples/multi.flat.txt +21 -21
- data/examples/multi.graph.html +693 -839
- data/examples/multi.grind.dat +93 -173
- data/examples/multi.stack.html +411 -437
- data/examples/stack.html +411 -437
- data/lib/ruby-prof/assets/call_stack_printer.css.html +117 -0
- data/lib/ruby-prof/assets/call_stack_printer.js.html +385 -0
- data/lib/ruby-prof/assets/call_stack_printer.png +0 -0
- data/lib/ruby-prof/printers/flat_printer.rb +1 -1
- data/lib/ruby-prof/printers/graph_html_printer.rb +43 -48
- data/lib/ruby-prof/version.rb +1 -1
- data/ruby-prof.gemspec +1 -1
- data/test/measure_memory_test.rb +5 -3
- data/test/printers_test.rb +1 -1
- metadata +5 -58
- data/doc/LICENSE.html +0 -114
- data/doc/README_rdoc.html +0 -592
- data/doc/Rack.html +0 -95
- data/doc/Rack/RubyProf.html +0 -264
- data/doc/RubyProf.html +0 -961
- data/doc/RubyProf/AbstractPrinter.html +0 -546
- data/doc/RubyProf/AggregateCallInfo.html +0 -537
- data/doc/RubyProf/CallInfo.html +0 -716
- data/doc/RubyProf/CallInfoPrinter.html +0 -120
- data/doc/RubyProf/CallInfoVisitor.html +0 -198
- data/doc/RubyProf/CallStackPrinter.html +0 -1121
- data/doc/RubyProf/CallTreePrinter.html +0 -359
- data/doc/RubyProf/Cmd.html +0 -631
- data/doc/RubyProf/DotPrinter.html +0 -257
- data/doc/RubyProf/FlatPrinter.html +0 -163
- data/doc/RubyProf/FlatPrinterWithLineNumbers.html +0 -208
- data/doc/RubyProf/GraphHtmlPrinter.html +0 -579
- data/doc/RubyProf/GraphPrinter.html +0 -139
- data/doc/RubyProf/MethodInfo.html +0 -885
- data/doc/RubyProf/MultiPrinter.html +0 -358
- data/doc/RubyProf/Profile.html +0 -713
- data/doc/RubyProf/ProfileTask.html +0 -490
- data/doc/RubyProf/Thread.html +0 -303
- 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 -618
- data/doc/table_of_contents.html +0 -934
- data/examples/empty.png +0 -0
- data/examples/graph.png +0 -0
- data/examples/minus.png +0 -0
- data/examples/plus.png +0 -0
data/doc/Rack.html
DELETED
@@ -1,95 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>module Rack - 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="module">
|
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
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
</div>
|
62
|
-
</nav>
|
63
|
-
|
64
|
-
<main role="main" aria-labelledby="module-Rack">
|
65
|
-
<h1 id="module-Rack" class="module">
|
66
|
-
module Rack
|
67
|
-
</h1>
|
68
|
-
|
69
|
-
<section class="description">
|
70
|
-
|
71
|
-
</section>
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
</section>
|
87
|
-
</main>
|
88
|
-
|
89
|
-
|
90
|
-
<footer id="validator-badges" role="contentinfo">
|
91
|
-
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
92
|
-
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
|
93
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
94
|
-
</footer>
|
95
|
-
|
data/doc/Rack/RubyProf.html
DELETED
@@ -1,264 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>class Rack::RubyProf - 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-c-new">::new</a>
|
74
|
-
|
75
|
-
<li ><a href="#method-i-call">#call</a>
|
76
|
-
|
77
|
-
<li ><a href="#method-i-print">#print</a>
|
78
|
-
|
79
|
-
</ul>
|
80
|
-
</div>
|
81
|
-
|
82
|
-
</div>
|
83
|
-
</nav>
|
84
|
-
|
85
|
-
<main role="main" aria-labelledby="class-Rack::RubyProf">
|
86
|
-
<h1 id="class-Rack::RubyProf" class="class">
|
87
|
-
class Rack::RubyProf
|
88
|
-
</h1>
|
89
|
-
|
90
|
-
<section class="description">
|
91
|
-
|
92
|
-
</section>
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
108
|
-
<header>
|
109
|
-
<h3>Public Class Methods</h3>
|
110
|
-
</header>
|
111
|
-
|
112
|
-
|
113
|
-
<div id="method-c-new" class="method-detail ">
|
114
|
-
|
115
|
-
<div class="method-heading">
|
116
|
-
<span class="method-name">new</span><span
|
117
|
-
class="method-args">(app, options = {})</span>
|
118
|
-
|
119
|
-
<span class="method-click-advice">click to toggle source</span>
|
120
|
-
|
121
|
-
</div>
|
122
|
-
|
123
|
-
|
124
|
-
<div class="method-description">
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
<div class="method-source-code" id="new-source">
|
132
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/rack.rb, line 5</span>
|
133
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">app</span>, <span class="ruby-identifier">options</span> = {})
|
134
|
-
<span class="ruby-ivar">@app</span> = <span class="ruby-identifier">app</span>
|
135
|
-
<span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>
|
136
|
-
<span class="ruby-ivar">@options</span>[<span class="ruby-value">:min_percent</span>] <span class="ruby-operator">||=</span> <span class="ruby-value">1</span>
|
137
|
-
|
138
|
-
<span class="ruby-ivar">@tmpdir</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:path</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">tmpdir</span>
|
139
|
-
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-ivar">@tmpdir</span>)
|
140
|
-
|
141
|
-
<span class="ruby-ivar">@printer_klasses</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-value">:printers</span>] <span class="ruby-operator">||</span> {<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">FlatPrinter</span> =<span class="ruby-operator">></span> <span class="ruby-string">'flat.txt'</span>,
|
142
|
-
<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">GraphPrinter</span> =<span class="ruby-operator">></span> <span class="ruby-string">'graph.txt'</span>,
|
143
|
-
<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">GraphHtmlPrinter</span> =<span class="ruby-operator">></span> <span class="ruby-string">'graph.html'</span>,
|
144
|
-
<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">CallStackPrinter</span> =<span class="ruby-operator">></span> <span class="ruby-string">'call_stack.html'</span>}
|
145
|
-
|
146
|
-
<span class="ruby-ivar">@skip_paths</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:skip_paths</span>] <span class="ruby-operator">||</span> [<span class="ruby-regexp">%r{^/assets}</span>, <span class="ruby-regexp">%r{\.css$}</span>, <span class="ruby-regexp">%r{\.js$}</span>, <span class="ruby-regexp">%r{\.png$}</span>, <span class="ruby-regexp">%r{\.jpeg$}</span>, <span class="ruby-regexp">%r{\.jpg$}</span>, <span class="ruby-regexp">%r{\.gif$}</span>]
|
147
|
-
<span class="ruby-keyword">end</span></pre>
|
148
|
-
</div>
|
149
|
-
|
150
|
-
</div>
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
</div>
|
156
|
-
|
157
|
-
|
158
|
-
</section>
|
159
|
-
|
160
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
161
|
-
<header>
|
162
|
-
<h3>Public Instance Methods</h3>
|
163
|
-
</header>
|
164
|
-
|
165
|
-
|
166
|
-
<div id="method-i-call" class="method-detail ">
|
167
|
-
|
168
|
-
<div class="method-heading">
|
169
|
-
<span class="method-name">call</span><span
|
170
|
-
class="method-args">(env)</span>
|
171
|
-
|
172
|
-
<span class="method-click-advice">click to toggle source</span>
|
173
|
-
|
174
|
-
</div>
|
175
|
-
|
176
|
-
|
177
|
-
<div class="method-description">
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
<div class="method-source-code" id="call-source">
|
185
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/rack.rb, line 21</span>
|
186
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
|
187
|
-
<span class="ruby-identifier">request</span> = <span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">Request</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">env</span>)
|
188
|
-
|
189
|
-
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@skip_paths</span>.<span class="ruby-identifier">any?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">skip_path</span><span class="ruby-operator">|</span> <span class="ruby-identifier">skip_path</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">path</span>}
|
190
|
-
<span class="ruby-ivar">@app</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
|
191
|
-
<span class="ruby-keyword">else</span>
|
192
|
-
<span class="ruby-identifier">result</span> = <span class="ruby-keyword">nil</span>
|
193
|
-
<span class="ruby-identifier">data</span> = <span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">Profile</span>.<span class="ruby-identifier">profile</span> <span class="ruby-keyword">do</span>
|
194
|
-
<span class="ruby-identifier">result</span> = <span class="ruby-ivar">@app</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
|
195
|
-
<span class="ruby-keyword">end</span>
|
196
|
-
|
197
|
-
<span class="ruby-identifier">path</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string">'/'</span>, <span class="ruby-string">'-'</span>)
|
198
|
-
<span class="ruby-identifier">path</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">0</span>)
|
199
|
-
|
200
|
-
<span class="ruby-identifier">print</span>(<span class="ruby-identifier">data</span>, <span class="ruby-identifier">path</span>)
|
201
|
-
<span class="ruby-identifier">result</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-print" class="method-detail ">
|
215
|
-
|
216
|
-
<div class="method-heading">
|
217
|
-
<span class="method-name">print</span><span
|
218
|
-
class="method-args">(data, path)</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="print-source">
|
233
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/rack.rb, line 40</span>
|
234
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print</span>(<span class="ruby-identifier">data</span>, <span class="ruby-identifier">path</span>)
|
235
|
-
<span class="ruby-ivar">@printer_klasses</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">printer_klass</span>, <span class="ruby-identifier">base_name</span><span class="ruby-operator">|</span>
|
236
|
-
<span class="ruby-identifier">printer</span> = <span class="ruby-identifier">printer_klass</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">data</span>)
|
237
|
-
<span class="ruby-identifier">file_name</span> = <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@tmpdir</span>, <span class="ruby-node">"#{path}-#{base_name}"</span>)
|
238
|
-
<span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">file_name</span>, <span class="ruby-string">'wb'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
|
239
|
-
<span class="ruby-identifier">printer</span>.<span class="ruby-identifier">print</span>(<span class="ruby-identifier">file</span>, <span class="ruby-ivar">@options</span>)
|
240
|
-
<span class="ruby-keyword">end</span>
|
241
|
-
<span class="ruby-keyword">end</span>
|
242
|
-
<span class="ruby-keyword">end</span></pre>
|
243
|
-
</div>
|
244
|
-
|
245
|
-
</div>
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
</div>
|
251
|
-
|
252
|
-
|
253
|
-
</section>
|
254
|
-
|
255
|
-
</section>
|
256
|
-
</main>
|
257
|
-
|
258
|
-
|
259
|
-
<footer id="validator-badges" role="contentinfo">
|
260
|
-
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
261
|
-
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
|
262
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
263
|
-
</footer>
|
264
|
-
|
data/doc/RubyProf.html
DELETED
@@ -1,961 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>module RubyProf - 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="module">
|
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
|
-
|
58
|
-
|
59
|
-
|
60
|
-
<!-- Method Quickref -->
|
61
|
-
<div id="method-list-section" class="nav-section">
|
62
|
-
<h3>Methods</h3>
|
63
|
-
|
64
|
-
<ul class="link-list" role="directory">
|
65
|
-
|
66
|
-
<li ><a href="#method-c-cpu_frequency">::cpu_frequency</a>
|
67
|
-
|
68
|
-
<li ><a href="#method-c-exclude_threads">::exclude_threads</a>
|
69
|
-
|
70
|
-
<li ><a href="#method-c-exclude_threads-3D">::exclude_threads=</a>
|
71
|
-
|
72
|
-
<li ><a href="#method-c-figure_measure_mode">::figure_measure_mode</a>
|
73
|
-
|
74
|
-
<li ><a href="#method-c-measure_allocations">::measure_allocations</a>
|
75
|
-
|
76
|
-
<li ><a href="#method-c-measure_cpu_time">::measure_cpu_time</a>
|
77
|
-
|
78
|
-
<li ><a href="#method-c-measure_gc_runs">::measure_gc_runs</a>
|
79
|
-
|
80
|
-
<li ><a href="#method-c-measure_gc_time">::measure_gc_time</a>
|
81
|
-
|
82
|
-
<li ><a href="#method-c-measure_memory">::measure_memory</a>
|
83
|
-
|
84
|
-
<li ><a href="#method-c-measure_mode">::measure_mode</a>
|
85
|
-
|
86
|
-
<li ><a href="#method-c-measure_mode-3D">::measure_mode=</a>
|
87
|
-
|
88
|
-
<li ><a href="#method-c-measure_mode_string">::measure_mode_string</a>
|
89
|
-
|
90
|
-
<li ><a href="#method-c-measure_process_time">::measure_process_time</a>
|
91
|
-
|
92
|
-
<li ><a href="#method-c-measure_wall_time">::measure_wall_time</a>
|
93
|
-
|
94
|
-
<li ><a href="#method-c-pause">::pause</a>
|
95
|
-
|
96
|
-
<li ><a href="#method-c-profile">::profile</a>
|
97
|
-
|
98
|
-
<li ><a href="#method-c-resume">::resume</a>
|
99
|
-
|
100
|
-
<li ><a href="#method-c-running-3F">::running?</a>
|
101
|
-
|
102
|
-
<li ><a href="#method-c-start">::start</a>
|
103
|
-
|
104
|
-
<li ><a href="#method-c-start_script">::start_script</a>
|
105
|
-
|
106
|
-
<li ><a href="#method-c-stop">::stop</a>
|
107
|
-
|
108
|
-
</ul>
|
109
|
-
</div>
|
110
|
-
|
111
|
-
</div>
|
112
|
-
</nav>
|
113
|
-
|
114
|
-
<main role="main" aria-labelledby="module-RubyProf">
|
115
|
-
<h1 id="module-RubyProf" class="module">
|
116
|
-
module RubyProf
|
117
|
-
</h1>
|
118
|
-
|
119
|
-
<section class="description">
|
120
|
-
|
121
|
-
<p>The call info visitor class does a depth-first traversal across a list of
|
122
|
-
method infos. At each call_info node, the visitor executes the block
|
123
|
-
provided in the visit method. The block is passed two parameters, the event
|
124
|
-
and the call_info instance. Event will be either :enter or :exit.</p>
|
125
|
-
|
126
|
-
<pre class="ruby"><span class="ruby-identifier">visitor</span> = <span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">CallInfoVisitor</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">result</span>.<span class="ruby-identifier">threads</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">top_call_infos</span>)
|
127
|
-
|
128
|
-
<span class="ruby-identifier">method_names</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
129
|
-
|
130
|
-
<span class="ruby-identifier">visitor</span>.<span class="ruby-identifier">visit</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">call_info</span>, <span class="ruby-identifier">event</span><span class="ruby-operator">|</span>
|
131
|
-
<span class="ruby-identifier">method_names</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">target</span>.<span class="ruby-identifier">full_name</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">event</span> <span class="ruby-operator">==</span> :<span class="ruby-identifier">enter</span>
|
132
|
-
<span class="ruby-keyword">end</span>
|
133
|
-
|
134
|
-
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">method_names</span>
|
135
|
-
</pre>
|
136
|
-
|
137
|
-
<p>These methods are here for backwards compatability with previous <a
|
138
|
-
href="RubyProf.html">RubyProf</a> releases</p>
|
139
|
-
|
140
|
-
</section>
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
<section class="constants-list">
|
152
|
-
<header>
|
153
|
-
<h3>Constants</h3>
|
154
|
-
</header>
|
155
|
-
<dl>
|
156
|
-
|
157
|
-
<dt id="VERSION">VERSION
|
158
|
-
|
159
|
-
<dd>
|
160
|
-
|
161
|
-
|
162
|
-
</dl>
|
163
|
-
</section>
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
170
|
-
<header>
|
171
|
-
<h3>Public Class Methods</h3>
|
172
|
-
</header>
|
173
|
-
|
174
|
-
|
175
|
-
<div id="method-c-cpu_frequency" class="method-detail ">
|
176
|
-
|
177
|
-
<div class="method-heading">
|
178
|
-
<span class="method-name">cpu_frequency</span><span
|
179
|
-
class="method-args">()</span>
|
180
|
-
|
181
|
-
<span class="method-click-advice">click to toggle source</span>
|
182
|
-
|
183
|
-
</div>
|
184
|
-
|
185
|
-
|
186
|
-
<div class="method-description">
|
187
|
-
|
188
|
-
<p>Measurements</p>
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
<div class="method-source-code" id="cpu_frequency-source">
|
194
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 5</span>
|
195
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">cpu_frequency</span>
|
196
|
-
<span class="ruby-constant">Measure</span><span class="ruby-operator">::</span><span class="ruby-constant">CpuTime</span>.<span class="ruby-identifier">frequency</span>
|
197
|
-
<span class="ruby-keyword">end</span></pre>
|
198
|
-
</div>
|
199
|
-
|
200
|
-
</div>
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
</div>
|
206
|
-
|
207
|
-
|
208
|
-
<div id="method-c-exclude_threads" class="method-detail ">
|
209
|
-
|
210
|
-
|
211
|
-
<div class="method-heading">
|
212
|
-
<span class="method-callseq">
|
213
|
-
exclude_threads → exclude_threads
|
214
|
-
</span>
|
215
|
-
|
216
|
-
<span class="method-click-advice">click to toggle source</span>
|
217
|
-
|
218
|
-
</div>
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
<div class="method-description">
|
223
|
-
|
224
|
-
<p>Returns threads ruby-prof should exclude from profiling</p>
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
<div class="method-source-code" id="exclude_threads-source">
|
230
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 87</span>
|
231
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">exclude_threads</span>
|
232
|
-
<span class="ruby-ivar">@exclude_threads</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
233
|
-
<span class="ruby-keyword">end</span></pre>
|
234
|
-
</div>
|
235
|
-
|
236
|
-
</div>
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
</div>
|
242
|
-
|
243
|
-
|
244
|
-
<div id="method-c-exclude_threads-3D" class="method-detail ">
|
245
|
-
|
246
|
-
|
247
|
-
<div class="method-heading">
|
248
|
-
<span class="method-callseq">
|
249
|
-
exclude_threads= → void
|
250
|
-
</span>
|
251
|
-
|
252
|
-
<span class="method-click-advice">click to toggle source</span>
|
253
|
-
|
254
|
-
</div>
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
<div class="method-description">
|
259
|
-
|
260
|
-
<p>Specifies what threads ruby-prof should exclude from profiling</p>
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
<div class="method-source-code" id="exclude_threads-3D-source">
|
266
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 96</span>
|
267
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">exclude_threads=</span>(<span class="ruby-identifier">value</span>)
|
268
|
-
<span class="ruby-ivar">@exclude_threads</span> = <span class="ruby-identifier">value</span>
|
269
|
-
<span class="ruby-keyword">end</span></pre>
|
270
|
-
</div>
|
271
|
-
|
272
|
-
</div>
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
</div>
|
278
|
-
|
279
|
-
|
280
|
-
<div id="method-c-figure_measure_mode" class="method-detail ">
|
281
|
-
|
282
|
-
<div class="method-heading">
|
283
|
-
<span class="method-name">figure_measure_mode</span><span
|
284
|
-
class="method-args">()</span>
|
285
|
-
|
286
|
-
<span class="method-click-advice">click to toggle source</span>
|
287
|
-
|
288
|
-
</div>
|
289
|
-
|
290
|
-
|
291
|
-
<div class="method-description">
|
292
|
-
|
293
|
-
<p>Checks if the user specified the clock mode via the RUBY_PROF_MEASURE_MODE
|
294
|
-
environment variable</p>
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
<div class="method-source-code" id="figure_measure_mode-source">
|
300
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof.rb, line 34</span>
|
301
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">figure_measure_mode</span>
|
302
|
-
<span class="ruby-keyword">case</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">"RUBY_PROF_MEASURE_MODE"</span>]
|
303
|
-
<span class="ruby-keyword">when</span> <span class="ruby-string">"wall"</span>, <span class="ruby-string">"wall_time"</span>
|
304
|
-
<span class="ruby-constant">RubyProf</span>.<span class="ruby-identifier">measure_mode</span> = <span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">WALL_TIME</span>
|
305
|
-
<span class="ruby-keyword">when</span> <span class="ruby-string">"cpu"</span>, <span class="ruby-string">"cpu_time"</span>
|
306
|
-
<span class="ruby-constant">RubyProf</span>.<span class="ruby-identifier">measure_mode</span> = <span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">CPU_TIME</span>
|
307
|
-
<span class="ruby-keyword">when</span> <span class="ruby-string">"allocations"</span>
|
308
|
-
<span class="ruby-constant">RubyProf</span>.<span class="ruby-identifier">measure_mode</span> = <span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">ALLOCATIONS</span>
|
309
|
-
<span class="ruby-keyword">when</span> <span class="ruby-string">"memory"</span>
|
310
|
-
<span class="ruby-constant">RubyProf</span>.<span class="ruby-identifier">measure_mode</span> = <span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">MEMORY</span>
|
311
|
-
<span class="ruby-keyword">when</span> <span class="ruby-string">"process"</span>, <span class="ruby-string">"process_time"</span>
|
312
|
-
<span class="ruby-constant">RubyProf</span>.<span class="ruby-identifier">measure_mode</span> = <span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">PROCESS_TIME</span>
|
313
|
-
<span class="ruby-keyword">when</span> <span class="ruby-string">"gc_time"</span>
|
314
|
-
<span class="ruby-constant">RubyProf</span>.<span class="ruby-identifier">measure_mode</span> = <span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">GC_TIME</span>
|
315
|
-
<span class="ruby-keyword">when</span> <span class="ruby-string">"gc_runs"</span>
|
316
|
-
<span class="ruby-constant">RubyProf</span>.<span class="ruby-identifier">measure_mode</span> = <span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">GC_RUNS</span>
|
317
|
-
<span class="ruby-keyword">else</span>
|
318
|
-
<span class="ruby-comment"># the default is defined in the measure_mode reader</span>
|
319
|
-
<span class="ruby-keyword">end</span>
|
320
|
-
<span class="ruby-keyword">end</span></pre>
|
321
|
-
</div>
|
322
|
-
|
323
|
-
</div>
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
</div>
|
329
|
-
|
330
|
-
|
331
|
-
<div id="method-c-measure_allocations" class="method-detail ">
|
332
|
-
|
333
|
-
<div class="method-heading">
|
334
|
-
<span class="method-name">measure_allocations</span><span
|
335
|
-
class="method-args">()</span>
|
336
|
-
|
337
|
-
<span class="method-click-advice">click to toggle source</span>
|
338
|
-
|
339
|
-
</div>
|
340
|
-
|
341
|
-
|
342
|
-
<div class="method-description">
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
<div class="method-source-code" id="measure_allocations-source">
|
350
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 9</span>
|
351
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">measure_allocations</span>
|
352
|
-
<span class="ruby-constant">Measure</span><span class="ruby-operator">::</span><span class="ruby-constant">Allocations</span>.<span class="ruby-identifier">measure</span>
|
353
|
-
<span class="ruby-keyword">end</span></pre>
|
354
|
-
</div>
|
355
|
-
|
356
|
-
</div>
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
</div>
|
362
|
-
|
363
|
-
|
364
|
-
<div id="method-c-measure_cpu_time" class="method-detail ">
|
365
|
-
|
366
|
-
<div class="method-heading">
|
367
|
-
<span class="method-name">measure_cpu_time</span><span
|
368
|
-
class="method-args">()</span>
|
369
|
-
|
370
|
-
<span class="method-click-advice">click to toggle source</span>
|
371
|
-
|
372
|
-
</div>
|
373
|
-
|
374
|
-
|
375
|
-
<div class="method-description">
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
<div class="method-source-code" id="measure_cpu_time-source">
|
383
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 13</span>
|
384
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">measure_cpu_time</span>
|
385
|
-
<span class="ruby-constant">Measure</span><span class="ruby-operator">::</span><span class="ruby-constant">CpuTime</span>.<span class="ruby-identifier">measure</span>
|
386
|
-
<span class="ruby-keyword">end</span></pre>
|
387
|
-
</div>
|
388
|
-
|
389
|
-
</div>
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
</div>
|
395
|
-
|
396
|
-
|
397
|
-
<div id="method-c-measure_gc_runs" class="method-detail ">
|
398
|
-
|
399
|
-
<div class="method-heading">
|
400
|
-
<span class="method-name">measure_gc_runs</span><span
|
401
|
-
class="method-args">()</span>
|
402
|
-
|
403
|
-
<span class="method-click-advice">click to toggle source</span>
|
404
|
-
|
405
|
-
</div>
|
406
|
-
|
407
|
-
|
408
|
-
<div class="method-description">
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
<div class="method-source-code" id="measure_gc_runs-source">
|
416
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 17</span>
|
417
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">measure_gc_runs</span>
|
418
|
-
<span class="ruby-constant">Measure</span><span class="ruby-operator">::</span><span class="ruby-constant">GcRuns</span>.<span class="ruby-identifier">measure</span>
|
419
|
-
<span class="ruby-keyword">end</span></pre>
|
420
|
-
</div>
|
421
|
-
|
422
|
-
</div>
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
</div>
|
428
|
-
|
429
|
-
|
430
|
-
<div id="method-c-measure_gc_time" class="method-detail ">
|
431
|
-
|
432
|
-
<div class="method-heading">
|
433
|
-
<span class="method-name">measure_gc_time</span><span
|
434
|
-
class="method-args">()</span>
|
435
|
-
|
436
|
-
<span class="method-click-advice">click to toggle source</span>
|
437
|
-
|
438
|
-
</div>
|
439
|
-
|
440
|
-
|
441
|
-
<div class="method-description">
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
<div class="method-source-code" id="measure_gc_time-source">
|
449
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 21</span>
|
450
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">measure_gc_time</span>
|
451
|
-
<span class="ruby-constant">Measure</span><span class="ruby-operator">::</span><span class="ruby-constant">GcTime</span>.<span class="ruby-identifier">measure</span>
|
452
|
-
<span class="ruby-keyword">end</span></pre>
|
453
|
-
</div>
|
454
|
-
|
455
|
-
</div>
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
</div>
|
461
|
-
|
462
|
-
|
463
|
-
<div id="method-c-measure_memory" class="method-detail ">
|
464
|
-
|
465
|
-
<div class="method-heading">
|
466
|
-
<span class="method-name">measure_memory</span><span
|
467
|
-
class="method-args">()</span>
|
468
|
-
|
469
|
-
<span class="method-click-advice">click to toggle source</span>
|
470
|
-
|
471
|
-
</div>
|
472
|
-
|
473
|
-
|
474
|
-
<div class="method-description">
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
<div class="method-source-code" id="measure_memory-source">
|
482
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 25</span>
|
483
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">measure_memory</span>
|
484
|
-
<span class="ruby-constant">Measure</span><span class="ruby-operator">::</span><span class="ruby-constant">Memory</span>.<span class="ruby-identifier">measure</span>
|
485
|
-
<span class="ruby-keyword">end</span></pre>
|
486
|
-
</div>
|
487
|
-
|
488
|
-
</div>
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
</div>
|
494
|
-
|
495
|
-
|
496
|
-
<div id="method-c-measure_mode" class="method-detail ">
|
497
|
-
|
498
|
-
|
499
|
-
<div class="method-heading">
|
500
|
-
<span class="method-callseq">
|
501
|
-
measure_mode → measure_mode
|
502
|
-
</span>
|
503
|
-
|
504
|
-
<span class="method-click-advice">click to toggle source</span>
|
505
|
-
|
506
|
-
</div>
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
<div class="method-description">
|
511
|
-
|
512
|
-
<p>Returns what ruby-prof is measuring. Valid values include:</p>
|
513
|
-
|
514
|
-
<p>*RubyProf::PROCESS_TIME - Measure process time. This is default. It is
|
515
|
-
implemented using the clock functions in the C Runtime library.
|
516
|
-
*RubyProf::WALL_TIME - Measure wall time using gettimeofday on Linx and
|
517
|
-
GetLocalTime on Windows *RubyProf::CPU_TIME - Measure time using the CPU
|
518
|
-
clock counter. This mode is only supported on Pentium or PowerPC
|
519
|
-
platforms. *RubyProf::ALLOCATIONS - Measure object allocations. This
|
520
|
-
requires a patched Ruby interpreter. *RubyProf::MEMORY - Measure memory
|
521
|
-
size. This requires a patched Ruby interpreter. *RubyProf::GC_RUNS -
|
522
|
-
Measure number of garbage collections. This requires a patched Ruby
|
523
|
-
interpreter. *RubyProf::GC_TIME - Measure time spent doing garbage
|
524
|
-
collection. This requires a patched Ruby interpreter.*/</p>
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
<div class="method-source-code" id="measure_mode-source">
|
530
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 50</span>
|
531
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">measure_mode</span>
|
532
|
-
<span class="ruby-ivar">@measure_mode</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">WALL_TIME</span>
|
533
|
-
<span class="ruby-keyword">end</span></pre>
|
534
|
-
</div>
|
535
|
-
|
536
|
-
</div>
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
</div>
|
542
|
-
|
543
|
-
|
544
|
-
<div id="method-c-measure_mode-3D" class="method-detail ">
|
545
|
-
|
546
|
-
|
547
|
-
<div class="method-heading">
|
548
|
-
<span class="method-callseq">
|
549
|
-
measure_mode=value → void
|
550
|
-
</span>
|
551
|
-
|
552
|
-
<span class="method-click-advice">click to toggle source</span>
|
553
|
-
|
554
|
-
</div>
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
<div class="method-description">
|
559
|
-
|
560
|
-
<p>Specifies what ruby-prof should measure. Valid values include:</p>
|
561
|
-
|
562
|
-
<p>*RubyProf::PROCESS_TIME - Measure process time. This is default. It is
|
563
|
-
implemented using the clock functions in the C Runtime library.
|
564
|
-
*RubyProf::WALL_TIME - Measure wall time using gettimeofday on Linx and
|
565
|
-
GetLocalTime on Windows *RubyProf::CPU_TIME - Measure time using the CPU
|
566
|
-
clock counter. This mode is only supported on Pentium or PowerPC
|
567
|
-
platforms. *RubyProf::ALLOCATIONS - Measure object allocations. This
|
568
|
-
requires a patched Ruby interpreter. *RubyProf::MEMORY - Measure memory
|
569
|
-
size. This requires a patched Ruby interpreter. *RubyProf::GC_RUNS -
|
570
|
-
Measure number of garbage collections. This requires a patched Ruby
|
571
|
-
interpreter. *RubyProf::GC_TIME - Measure time spent doing garbage
|
572
|
-
collection. This requires a patched Ruby interpreter.*/</p>
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
<div class="method-source-code" id="measure_mode-3D-source">
|
578
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 66</span>
|
579
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">measure_mode=</span>(<span class="ruby-identifier">value</span>)
|
580
|
-
<span class="ruby-ivar">@measure_mode</span> = <span class="ruby-identifier">value</span>
|
581
|
-
<span class="ruby-keyword">end</span></pre>
|
582
|
-
</div>
|
583
|
-
|
584
|
-
</div>
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
</div>
|
590
|
-
|
591
|
-
|
592
|
-
<div id="method-c-measure_mode_string" class="method-detail ">
|
593
|
-
|
594
|
-
<div class="method-heading">
|
595
|
-
<span class="method-name">measure_mode_string</span><span
|
596
|
-
class="method-args">()</span>
|
597
|
-
|
598
|
-
<span class="method-click-advice">click to toggle source</span>
|
599
|
-
|
600
|
-
</div>
|
601
|
-
|
602
|
-
|
603
|
-
<div class="method-description">
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
<div class="method-source-code" id="measure_mode_string-source">
|
611
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 70</span>
|
612
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">measure_mode_string</span>
|
613
|
-
<span class="ruby-keyword">case</span> <span class="ruby-identifier">measure_mode</span>
|
614
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">WALL_TIME</span> <span class="ruby-keyword">then</span> <span class="ruby-string">"wall_time"</span>
|
615
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">CPU_TIME</span> <span class="ruby-keyword">then</span> <span class="ruby-string">"cpu_time"</span>
|
616
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">PROCESS_TIME</span> <span class="ruby-keyword">then</span> <span class="ruby-string">"process_time_time"</span>
|
617
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">ALLOCATIONS</span> <span class="ruby-keyword">then</span> <span class="ruby-string">"allocations"</span>
|
618
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">MEMORY</span> <span class="ruby-keyword">then</span> <span class="ruby-string">"memory"</span>
|
619
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">GC_TIME</span> <span class="ruby-keyword">then</span> <span class="ruby-string">"gc_time"</span>
|
620
|
-
<span class="ruby-keyword">when</span> <span class="ruby-constant">GC_RUNS</span> <span class="ruby-keyword">then</span> <span class="ruby-string">"gc_runs"</span>
|
621
|
-
<span class="ruby-keyword">end</span>
|
622
|
-
<span class="ruby-keyword">end</span></pre>
|
623
|
-
</div>
|
624
|
-
|
625
|
-
</div>
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
</div>
|
631
|
-
|
632
|
-
|
633
|
-
<div id="method-c-measure_process_time" class="method-detail ">
|
634
|
-
|
635
|
-
<div class="method-heading">
|
636
|
-
<span class="method-name">measure_process_time</span><span
|
637
|
-
class="method-args">()</span>
|
638
|
-
|
639
|
-
<span class="method-click-advice">click to toggle source</span>
|
640
|
-
|
641
|
-
</div>
|
642
|
-
|
643
|
-
|
644
|
-
<div class="method-description">
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
<div class="method-source-code" id="measure_process_time-source">
|
652
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 29</span>
|
653
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">measure_process_time</span>
|
654
|
-
<span class="ruby-constant">Measure</span><span class="ruby-operator">::</span><span class="ruby-constant">ProcessTime</span>.<span class="ruby-identifier">measure</span>
|
655
|
-
<span class="ruby-keyword">end</span></pre>
|
656
|
-
</div>
|
657
|
-
|
658
|
-
</div>
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
</div>
|
664
|
-
|
665
|
-
|
666
|
-
<div id="method-c-measure_wall_time" class="method-detail ">
|
667
|
-
|
668
|
-
<div class="method-heading">
|
669
|
-
<span class="method-name">measure_wall_time</span><span
|
670
|
-
class="method-args">()</span>
|
671
|
-
|
672
|
-
<span class="method-click-advice">click to toggle source</span>
|
673
|
-
|
674
|
-
</div>
|
675
|
-
|
676
|
-
|
677
|
-
<div class="method-description">
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
<div class="method-source-code" id="measure_wall_time-source">
|
685
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 33</span>
|
686
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">measure_wall_time</span>
|
687
|
-
<span class="ruby-constant">Measure</span><span class="ruby-operator">::</span><span class="ruby-constant">WallTime</span>.<span class="ruby-identifier">measure</span>
|
688
|
-
<span class="ruby-keyword">end</span></pre>
|
689
|
-
</div>
|
690
|
-
|
691
|
-
</div>
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
</div>
|
697
|
-
|
698
|
-
|
699
|
-
<div id="method-c-pause" class="method-detail ">
|
700
|
-
|
701
|
-
<div class="method-heading">
|
702
|
-
<span class="method-name">pause</span><span
|
703
|
-
class="method-args">()</span>
|
704
|
-
|
705
|
-
<span class="method-click-advice">click to toggle source</span>
|
706
|
-
|
707
|
-
</div>
|
708
|
-
|
709
|
-
|
710
|
-
<div class="method-description">
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
<div class="method-source-code" id="pause-source">
|
718
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 113</span>
|
719
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">pause</span>
|
720
|
-
<span class="ruby-identifier">ensure_running!</span>
|
721
|
-
<span class="ruby-identifier">disable_gc_stats_if_needed</span>
|
722
|
-
<span class="ruby-ivar">@profile</span>.<span class="ruby-identifier">pause</span>
|
723
|
-
<span class="ruby-keyword">end</span></pre>
|
724
|
-
</div>
|
725
|
-
|
726
|
-
</div>
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
</div>
|
732
|
-
|
733
|
-
|
734
|
-
<div id="method-c-profile" class="method-detail ">
|
735
|
-
|
736
|
-
<div class="method-heading">
|
737
|
-
<span class="method-name">profile</span><span
|
738
|
-
class="method-args">(&block)</span>
|
739
|
-
|
740
|
-
<span class="method-click-advice">click to toggle source</span>
|
741
|
-
|
742
|
-
</div>
|
743
|
-
|
744
|
-
|
745
|
-
<div class="method-description">
|
746
|
-
|
747
|
-
<p><a href="RubyProf/Profile.html">Profile</a> a block</p>
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
<div class="method-source-code" id="profile-source">
|
753
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 142</span>
|
754
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">profile</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
755
|
-
<span class="ruby-identifier">ensure_not_running!</span>
|
756
|
-
<span class="ruby-identifier">gc_stat_was_enabled</span> = <span class="ruby-identifier">enable_gc_stats_if_needed</span>
|
757
|
-
<span class="ruby-identifier">res</span> = <span class="ruby-constant">Profile</span>.<span class="ruby-identifier">profile</span>(<span class="ruby-keyword">self</span>.<span class="ruby-identifier">measure_mode</span>, <span class="ruby-keyword">self</span>.<span class="ruby-identifier">exclude_threads</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
758
|
-
<span class="ruby-identifier">disable_gc_stats_if_needed</span>(<span class="ruby-identifier">gc_stat_was_enabled</span>)
|
759
|
-
<span class="ruby-identifier">res</span>
|
760
|
-
<span class="ruby-keyword">end</span></pre>
|
761
|
-
</div>
|
762
|
-
|
763
|
-
</div>
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
</div>
|
769
|
-
|
770
|
-
|
771
|
-
<div id="method-c-resume" class="method-detail ">
|
772
|
-
|
773
|
-
<div class="method-heading">
|
774
|
-
<span class="method-name">resume</span><span
|
775
|
-
class="method-args">()</span>
|
776
|
-
|
777
|
-
<span class="method-click-advice">click to toggle source</span>
|
778
|
-
|
779
|
-
</div>
|
780
|
-
|
781
|
-
|
782
|
-
<div class="method-description">
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
<div class="method-source-code" id="resume-source">
|
790
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 127</span>
|
791
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">resume</span>
|
792
|
-
<span class="ruby-identifier">ensure_running!</span>
|
793
|
-
<span class="ruby-identifier">enable_gc_stats_if_needed</span>
|
794
|
-
<span class="ruby-ivar">@profile</span>.<span class="ruby-identifier">resume</span>
|
795
|
-
<span class="ruby-keyword">end</span></pre>
|
796
|
-
</div>
|
797
|
-
|
798
|
-
</div>
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
</div>
|
804
|
-
|
805
|
-
|
806
|
-
<div id="method-c-running-3F" class="method-detail ">
|
807
|
-
|
808
|
-
<div class="method-heading">
|
809
|
-
<span class="method-name">running?</span><span
|
810
|
-
class="method-args">()</span>
|
811
|
-
|
812
|
-
<span class="method-click-advice">click to toggle source</span>
|
813
|
-
|
814
|
-
</div>
|
815
|
-
|
816
|
-
|
817
|
-
<div class="method-description">
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
<div class="method-source-code" id="running-3F-source">
|
825
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 119</span>
|
826
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">running?</span>
|
827
|
-
<span class="ruby-keyword">if</span> <span class="ruby-keyword">defined?</span>(<span class="ruby-ivar">@profile</span>) <span class="ruby-keyword">and</span> <span class="ruby-ivar">@profile</span>
|
828
|
-
<span class="ruby-ivar">@profile</span>.<span class="ruby-identifier">running?</span>
|
829
|
-
<span class="ruby-keyword">else</span>
|
830
|
-
<span class="ruby-keyword">false</span>
|
831
|
-
<span class="ruby-keyword">end</span>
|
832
|
-
<span class="ruby-keyword">end</span></pre>
|
833
|
-
</div>
|
834
|
-
|
835
|
-
</div>
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
</div>
|
841
|
-
|
842
|
-
|
843
|
-
<div id="method-c-start" class="method-detail ">
|
844
|
-
|
845
|
-
<div class="method-heading">
|
846
|
-
<span class="method-name">start</span><span
|
847
|
-
class="method-args">()</span>
|
848
|
-
|
849
|
-
<span class="method-click-advice">click to toggle source</span>
|
850
|
-
|
851
|
-
</div>
|
852
|
-
|
853
|
-
|
854
|
-
<div class="method-description">
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
<div class="method-source-code" id="start-source">
|
862
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 106</span>
|
863
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">start</span>
|
864
|
-
<span class="ruby-identifier">ensure_not_running!</span>
|
865
|
-
<span class="ruby-ivar">@profile</span> = <span class="ruby-constant">Profile</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword">self</span>.<span class="ruby-identifier">measure_mode</span>, <span class="ruby-keyword">self</span>.<span class="ruby-identifier">exclude_threads</span>)
|
866
|
-
<span class="ruby-identifier">enable_gc_stats_if_needed</span>
|
867
|
-
<span class="ruby-ivar">@profile</span>.<span class="ruby-identifier">start</span>
|
868
|
-
<span class="ruby-keyword">end</span></pre>
|
869
|
-
</div>
|
870
|
-
|
871
|
-
</div>
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
</div>
|
877
|
-
|
878
|
-
|
879
|
-
<div id="method-c-start_script" class="method-detail ">
|
880
|
-
|
881
|
-
<div class="method-heading">
|
882
|
-
<span class="method-name">start_script</span><span
|
883
|
-
class="method-args">(script)</span>
|
884
|
-
|
885
|
-
<span class="method-click-advice">click to toggle source</span>
|
886
|
-
|
887
|
-
</div>
|
888
|
-
|
889
|
-
|
890
|
-
<div class="method-description">
|
891
|
-
|
892
|
-
<p>Profiling</p>
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
<div class="method-source-code" id="start_script-source">
|
898
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 101</span>
|
899
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">start_script</span>(<span class="ruby-identifier">script</span>)
|
900
|
-
<span class="ruby-identifier">start</span>
|
901
|
-
<span class="ruby-identifier">load</span> <span class="ruby-identifier">script</span>
|
902
|
-
<span class="ruby-keyword">end</span></pre>
|
903
|
-
</div>
|
904
|
-
|
905
|
-
</div>
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
</div>
|
911
|
-
|
912
|
-
|
913
|
-
<div id="method-c-stop" class="method-detail ">
|
914
|
-
|
915
|
-
<div class="method-heading">
|
916
|
-
<span class="method-name">stop</span><span
|
917
|
-
class="method-args">()</span>
|
918
|
-
|
919
|
-
<span class="method-click-advice">click to toggle source</span>
|
920
|
-
|
921
|
-
</div>
|
922
|
-
|
923
|
-
|
924
|
-
<div class="method-description">
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
<div class="method-source-code" id="stop-source">
|
932
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 133</span>
|
933
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">stop</span>
|
934
|
-
<span class="ruby-identifier">ensure_running!</span>
|
935
|
-
<span class="ruby-identifier">result</span> = <span class="ruby-ivar">@profile</span>.<span class="ruby-identifier">stop</span>
|
936
|
-
<span class="ruby-identifier">disable_gc_stats_if_needed</span>
|
937
|
-
<span class="ruby-ivar">@profile</span> = <span class="ruby-keyword">nil</span>
|
938
|
-
<span class="ruby-identifier">result</span>
|
939
|
-
<span class="ruby-keyword">end</span></pre>
|
940
|
-
</div>
|
941
|
-
|
942
|
-
</div>
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
</div>
|
948
|
-
|
949
|
-
|
950
|
-
</section>
|
951
|
-
|
952
|
-
</section>
|
953
|
-
</main>
|
954
|
-
|
955
|
-
|
956
|
-
<footer id="validator-badges" role="contentinfo">
|
957
|
-
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
958
|
-
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
|
959
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
960
|
-
</footer>
|
961
|
-
|