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