ruby-prof 0.13.1 → 1.4.2
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 +5 -5
- data/CHANGES +579 -371
- data/LICENSE +24 -23
- data/README.rdoc +5 -433
- data/Rakefile +98 -110
- data/bin/ruby-prof +328 -329
- data/bin/ruby-prof-check-trace +45 -0
- data/ext/ruby_prof/extconf.rb +16 -59
- data/ext/ruby_prof/rp_aggregate_call_tree.c +59 -0
- data/ext/ruby_prof/rp_aggregate_call_tree.h +13 -0
- data/ext/ruby_prof/rp_allocation.c +287 -0
- data/ext/ruby_prof/rp_allocation.h +31 -0
- data/ext/ruby_prof/rp_call_tree.c +369 -0
- data/ext/ruby_prof/rp_call_tree.h +43 -0
- data/ext/ruby_prof/rp_call_trees.c +288 -0
- data/ext/ruby_prof/rp_call_trees.h +28 -0
- data/ext/ruby_prof/rp_measure_allocations.c +50 -65
- data/ext/ruby_prof/rp_measure_memory.c +42 -73
- data/ext/ruby_prof/rp_measure_process_time.c +65 -71
- data/ext/ruby_prof/rp_measure_wall_time.c +64 -42
- data/ext/ruby_prof/rp_measurement.c +237 -0
- data/ext/ruby_prof/rp_measurement.h +50 -0
- data/ext/ruby_prof/rp_method.c +491 -420
- data/ext/ruby_prof/rp_method.h +62 -57
- data/ext/ruby_prof/rp_profile.c +908 -0
- data/ext/ruby_prof/rp_profile.h +35 -0
- data/ext/ruby_prof/rp_stack.c +212 -128
- data/ext/ruby_prof/rp_stack.h +53 -51
- data/ext/ruby_prof/rp_thread.c +362 -268
- data/ext/ruby_prof/rp_thread.h +39 -27
- data/ext/ruby_prof/ruby_prof.c +52 -695
- data/ext/ruby_prof/ruby_prof.h +26 -55
- data/ext/ruby_prof/vc/ruby_prof.sln +28 -21
- data/ext/ruby_prof/vc/{ruby_prof_20.vcxproj → ruby_prof.vcxproj} +56 -8
- data/lib/ruby-prof.rb +52 -67
- data/lib/ruby-prof/assets/call_stack_printer.html.erb +710 -0
- data/lib/ruby-prof/assets/call_stack_printer.png +0 -0
- data/lib/ruby-prof/assets/graph_printer.html.erb +355 -0
- data/lib/ruby-prof/call_tree.rb +57 -0
- data/lib/ruby-prof/call_tree_visitor.rb +36 -0
- data/lib/ruby-prof/compatibility.rb +99 -169
- data/lib/ruby-prof/exclude_common_methods.rb +198 -0
- data/lib/ruby-prof/measurement.rb +17 -0
- data/lib/ruby-prof/method_info.rb +78 -131
- data/lib/ruby-prof/printers/abstract_printer.rb +137 -85
- data/lib/ruby-prof/printers/call_info_printer.rb +53 -41
- data/lib/ruby-prof/printers/call_stack_printer.rb +180 -773
- data/lib/ruby-prof/printers/call_tree_printer.rb +151 -92
- data/lib/ruby-prof/printers/dot_printer.rb +132 -132
- data/lib/ruby-prof/printers/flat_printer.rb +53 -69
- data/lib/ruby-prof/printers/graph_html_printer.rb +63 -255
- data/lib/ruby-prof/printers/graph_printer.rb +113 -116
- data/lib/ruby-prof/printers/multi_printer.rb +127 -56
- data/lib/ruby-prof/profile.rb +37 -77
- data/lib/ruby-prof/rack.rb +62 -15
- data/lib/ruby-prof/task.rb +147 -147
- data/lib/ruby-prof/thread.rb +10 -12
- data/lib/ruby-prof/version.rb +3 -0
- data/lib/unprof.rb +10 -10
- data/ruby-prof.gemspec +65 -61
- data/test/abstract_printer_test.rb +26 -0
- data/test/alias_test.rb +126 -0
- data/test/basic_test.rb +43 -128
- data/test/call_tree_visitor_test.rb +32 -0
- data/test/call_trees_test.rb +66 -0
- data/test/duplicate_names_test.rb +32 -32
- data/test/dynamic_method_test.rb +53 -74
- data/test/enumerable_test.rb +21 -16
- data/test/exceptions_test.rb +24 -16
- data/test/exclude_methods_test.rb +151 -0
- data/test/exclude_threads_test.rb +53 -54
- data/test/fiber_test.rb +129 -65
- data/test/gc_test.rb +90 -0
- data/test/inverse_call_tree_test.rb +175 -0
- data/test/line_number_test.rb +158 -71
- data/test/marshal_test.rb +113 -0
- data/test/measure_allocations.rb +30 -0
- data/test/measure_allocations_test.rb +375 -25
- data/test/measure_allocations_trace_test.rb +375 -0
- data/test/measure_memory_trace_test.rb +1101 -0
- data/test/measure_process_time_test.rb +785 -62
- data/test/measure_times.rb +56 -0
- data/test/measure_wall_time_test.rb +434 -254
- data/test/multi_printer_test.rb +71 -82
- data/test/no_method_class_test.rb +15 -15
- data/test/pause_resume_test.rb +175 -166
- data/test/prime.rb +54 -54
- data/test/prime_script.rb +6 -0
- data/test/printer_call_stack_test.rb +27 -0
- data/test/printer_call_tree_test.rb +30 -0
- data/test/printer_flat_test.rb +99 -0
- data/test/printer_graph_html_test.rb +59 -0
- data/test/printer_graph_test.rb +40 -0
- data/test/printers_test.rb +141 -257
- data/test/printing_recursive_graph_test.rb +81 -0
- data/test/profile_test.rb +16 -0
- data/test/rack_test.rb +93 -0
- data/test/recursive_test.rb +206 -215
- data/test/singleton_test.rb +38 -38
- data/test/stack_printer_test.rb +64 -78
- data/test/start_stop_test.rb +109 -112
- data/test/test_helper.rb +13 -115
- data/test/thread_test.rb +144 -178
- data/test/unique_call_path_test.rb +120 -224
- data/test/yarv_test.rb +56 -0
- metadata +77 -133
- data/doc/LICENSE.html +0 -155
- data/doc/README_rdoc.html +0 -648
- data/doc/Rack.html +0 -167
- data/doc/Rack/RubyProf.html +0 -319
- data/doc/RubyProf.html +0 -1000
- data/doc/RubyProf/AbstractPrinter.html +0 -580
- data/doc/RubyProf/AggregateCallInfo.html +0 -570
- data/doc/RubyProf/CallInfo.html +0 -512
- data/doc/RubyProf/CallInfoPrinter.html +0 -190
- data/doc/RubyProf/CallInfoVisitor.html +0 -332
- data/doc/RubyProf/CallStackPrinter.html +0 -1600
- data/doc/RubyProf/CallTreePrinter.html +0 -413
- data/doc/RubyProf/Cmd.html +0 -669
- data/doc/RubyProf/DotPrinter.html +0 -312
- data/doc/RubyProf/FlatPrinter.html +0 -229
- data/doc/RubyProf/FlatPrinterWithLineNumbers.html +0 -267
- data/doc/RubyProf/GraphHtmlPrinter.html +0 -630
- data/doc/RubyProf/GraphPrinter.html +0 -209
- data/doc/RubyProf/MethodInfo.html +0 -713
- data/doc/RubyProf/MultiPrinter.html +0 -407
- data/doc/RubyProf/Profile.html +0 -821
- data/doc/RubyProf/ProfileTask.html +0 -532
- data/doc/RubyProf/Test.html +0 -578
- data/doc/RubyProf/Thread.html +0 -262
- data/doc/created.rid +0 -32
- data/doc/examples/flat_txt.html +0 -191
- data/doc/examples/graph_txt.html +0 -305
- data/doc/images/add.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +0 -647
- data/doc/js/darkfish.js +0 -155
- data/doc/js/jquery.js +0 -18
- data/doc/js/navigation.js +0 -142
- data/doc/js/search.js +0 -94
- data/doc/js/search_index.js +0 -1
- data/doc/js/searcher.js +0 -228
- data/doc/rdoc.css +0 -543
- data/doc/table_of_contents.html +0 -462
- data/examples/empty.png +0 -0
- data/examples/flat.txt +0 -55
- data/examples/graph.dot +0 -106
- data/examples/graph.html +0 -823
- data/examples/graph.png +0 -0
- data/examples/graph.txt +0 -170
- data/examples/minus.png +0 -0
- data/examples/multi.flat.txt +0 -23
- data/examples/multi.graph.html +0 -906
- data/examples/multi.grind.dat +0 -194
- data/examples/multi.stack.html +0 -573
- data/examples/plus.png +0 -0
- data/examples/stack.html +0 -573
- data/ext/ruby_prof/rp_call_info.c +0 -407
- data/ext/ruby_prof/rp_call_info.h +0 -48
- data/ext/ruby_prof/rp_measure.c +0 -48
- data/ext/ruby_prof/rp_measure.h +0 -45
- data/ext/ruby_prof/rp_measure_cpu_time.c +0 -112
- data/ext/ruby_prof/rp_measure_gc_runs.c +0 -65
- data/ext/ruby_prof/rp_measure_gc_time.c +0 -57
- data/ext/ruby_prof/vc/ruby_prof_18.vcxproj +0 -108
- data/ext/ruby_prof/vc/ruby_prof_19.vcxproj +0 -110
- data/ext/ruby_prof/version.h +0 -7
- data/lib/ruby-prof/aggregate_call_info.rb +0 -72
- data/lib/ruby-prof/call_info.rb +0 -89
- data/lib/ruby-prof/call_info_visitor.rb +0 -44
- data/lib/ruby-prof/images/empty.png +0 -0
- data/lib/ruby-prof/images/minus.png +0 -0
- data/lib/ruby-prof/images/plus.png +0 -0
- data/lib/ruby-prof/printers/flat_printer_with_line_numbers.rb +0 -57
- data/lib/ruby-prof/test.rb +0 -150
- data/test/aggregate_test.rb +0 -136
- data/test/call_info_test.rb +0 -78
- data/test/call_info_visitor_test.rb +0 -31
- data/test/exec_test.rb +0 -14
- data/test/measure_cpu_time_test.rb +0 -220
- data/test/measure_gc_runs_test.rb +0 -32
- data/test/measure_gc_time_test.rb +0 -36
- data/test/measure_memory_test.rb +0 -31
- data/test/method_elimination_test.rb +0 -84
- data/test/module_test.rb +0 -45
- data/test/stack_test.rb +0 -138
- data/test/test_suite.rb +0 -37
data/doc/RubyProf.html
DELETED
@@ -1,1000 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
-
|
7
|
-
<title>module RubyProf - ruby-prof</title>
|
8
|
-
|
9
|
-
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
10
|
-
|
11
|
-
<script type="text/javascript">
|
12
|
-
var rdoc_rel_prefix = "./";
|
13
|
-
</script>
|
14
|
-
|
15
|
-
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
16
|
-
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
17
|
-
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
18
|
-
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
19
|
-
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
20
|
-
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
21
|
-
|
22
|
-
|
23
|
-
<body id="top" class="module">
|
24
|
-
<nav id="metadata">
|
25
|
-
<nav id="home-section" class="section">
|
26
|
-
<h3 class="section-header">
|
27
|
-
<a href="./index.html">Home</a>
|
28
|
-
<a href="./table_of_contents.html#classes">Classes</a>
|
29
|
-
<a href="./table_of_contents.html#methods">Methods</a>
|
30
|
-
</h3>
|
31
|
-
</nav>
|
32
|
-
|
33
|
-
|
34
|
-
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
-
<form action="#" method="get" accept-charset="utf-8">
|
36
|
-
<h3 class="section-header">
|
37
|
-
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
-
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
-
</h3>
|
40
|
-
</form>
|
41
|
-
|
42
|
-
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
-
</nav>
|
44
|
-
|
45
|
-
|
46
|
-
<div id="file-metadata">
|
47
|
-
<nav id="file-list-section" class="section">
|
48
|
-
<h3 class="section-header">Defined In</h3>
|
49
|
-
<ul>
|
50
|
-
<li>bin/ruby-prof
|
51
|
-
<li>lib/ruby-prof.rb
|
52
|
-
<li>lib/ruby-prof/aggregate_call_info.rb
|
53
|
-
<li>lib/ruby-prof/call_info.rb
|
54
|
-
<li>lib/ruby-prof/call_info_visitor.rb
|
55
|
-
<li>lib/ruby-prof/compatibility.rb
|
56
|
-
<li>lib/ruby-prof/method_info.rb
|
57
|
-
<li>lib/ruby-prof/printers/abstract_printer.rb
|
58
|
-
<li>lib/ruby-prof/printers/call_info_printer.rb
|
59
|
-
<li>lib/ruby-prof/printers/call_stack_printer.rb
|
60
|
-
<li>lib/ruby-prof/printers/call_tree_printer.rb
|
61
|
-
<li>lib/ruby-prof/printers/dot_printer.rb
|
62
|
-
<li>lib/ruby-prof/printers/flat_printer.rb
|
63
|
-
<li>lib/ruby-prof/printers/flat_printer_with_line_numbers.rb
|
64
|
-
<li>lib/ruby-prof/printers/graph_html_printer.rb
|
65
|
-
<li>lib/ruby-prof/printers/graph_printer.rb
|
66
|
-
<li>lib/ruby-prof/printers/multi_printer.rb
|
67
|
-
<li>lib/ruby-prof/profile.rb
|
68
|
-
<li>lib/ruby-prof/task.rb
|
69
|
-
<li>lib/ruby-prof/test.rb
|
70
|
-
<li>lib/ruby-prof/thread.rb
|
71
|
-
<li>ext/ruby_prof/ruby_prof.c
|
72
|
-
</ul>
|
73
|
-
</nav>
|
74
|
-
|
75
|
-
|
76
|
-
</div>
|
77
|
-
|
78
|
-
<div id="class-metadata">
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
<!-- Method Quickref -->
|
83
|
-
<nav id="method-list-section" class="section">
|
84
|
-
<h3 class="section-header">Methods</h3>
|
85
|
-
|
86
|
-
<ul class="link-list">
|
87
|
-
|
88
|
-
<li><a href="#method-c-cpu_frequency">::cpu_frequency</a>
|
89
|
-
|
90
|
-
<li><a href="#method-c-cpu_frequency-3D">::cpu_frequency=</a>
|
91
|
-
|
92
|
-
<li><a href="#method-c-exclude_threads">::exclude_threads</a>
|
93
|
-
|
94
|
-
<li><a href="#method-c-exclude_threads-3D">::exclude_threads=</a>
|
95
|
-
|
96
|
-
<li><a href="#method-c-figure_measure_mode">::figure_measure_mode</a>
|
97
|
-
|
98
|
-
<li><a href="#method-c-measure_allocations">::measure_allocations</a>
|
99
|
-
|
100
|
-
<li><a href="#method-c-measure_cpu_time">::measure_cpu_time</a>
|
101
|
-
|
102
|
-
<li><a href="#method-c-measure_gc_runs">::measure_gc_runs</a>
|
103
|
-
|
104
|
-
<li><a href="#method-c-measure_gc_time">::measure_gc_time</a>
|
105
|
-
|
106
|
-
<li><a href="#method-c-measure_memory">::measure_memory</a>
|
107
|
-
|
108
|
-
<li><a href="#method-c-measure_mode">::measure_mode</a>
|
109
|
-
|
110
|
-
<li><a href="#method-c-measure_mode-3D">::measure_mode=</a>
|
111
|
-
|
112
|
-
<li><a href="#method-c-measure_process_time">::measure_process_time</a>
|
113
|
-
|
114
|
-
<li><a href="#method-c-measure_wall_time">::measure_wall_time</a>
|
115
|
-
|
116
|
-
<li><a href="#method-c-pause">::pause</a>
|
117
|
-
|
118
|
-
<li><a href="#method-c-profile">::profile</a>
|
119
|
-
|
120
|
-
<li><a href="#method-c-resume">::resume</a>
|
121
|
-
|
122
|
-
<li><a href="#method-c-running-3F">::running?</a>
|
123
|
-
|
124
|
-
<li><a href="#method-c-start">::start</a>
|
125
|
-
|
126
|
-
<li><a href="#method-c-start_script">::start_script</a>
|
127
|
-
|
128
|
-
<li><a href="#method-c-stop">::stop</a>
|
129
|
-
|
130
|
-
</ul>
|
131
|
-
</nav>
|
132
|
-
|
133
|
-
</div>
|
134
|
-
|
135
|
-
<div id="project-metadata">
|
136
|
-
<nav id="fileindex-section" class="section project-section">
|
137
|
-
<h3 class="section-header">Pages</h3>
|
138
|
-
|
139
|
-
<ul>
|
140
|
-
|
141
|
-
<li class="file"><a href="./LICENSE.html">LICENSE</a>
|
142
|
-
|
143
|
-
<li class="file"><a href="./README_rdoc.html">README</a>
|
144
|
-
|
145
|
-
<li class="file"><a href="./examples/flat_txt.html">flat</a>
|
146
|
-
|
147
|
-
<li class="file"><a href="./examples/graph_txt.html">graph</a>
|
148
|
-
|
149
|
-
</ul>
|
150
|
-
</nav>
|
151
|
-
|
152
|
-
<nav id="classindex-section" class="section project-section">
|
153
|
-
<h3 class="section-header">Class and Module Index</h3>
|
154
|
-
|
155
|
-
<ul class="link-list">
|
156
|
-
|
157
|
-
<li><a href="./RubyProf.html">RubyProf</a>
|
158
|
-
|
159
|
-
<li><a href="./RubyProf/AbstractPrinter.html">RubyProf::AbstractPrinter</a>
|
160
|
-
|
161
|
-
<li><a href="./RubyProf/AggregateCallInfo.html">RubyProf::AggregateCallInfo</a>
|
162
|
-
|
163
|
-
<li><a href="./RubyProf/CallInfo.html">RubyProf::CallInfo</a>
|
164
|
-
|
165
|
-
<li><a href="./RubyProf/CallInfoPrinter.html">RubyProf::CallInfoPrinter</a>
|
166
|
-
|
167
|
-
<li><a href="./RubyProf/CallInfoVisitor.html">RubyProf::CallInfoVisitor</a>
|
168
|
-
|
169
|
-
<li><a href="./RubyProf/CallStackPrinter.html">RubyProf::CallStackPrinter</a>
|
170
|
-
|
171
|
-
<li><a href="./RubyProf/CallTreePrinter.html">RubyProf::CallTreePrinter</a>
|
172
|
-
|
173
|
-
<li><a href="./RubyProf/Cmd.html">RubyProf::Cmd</a>
|
174
|
-
|
175
|
-
<li><a href="./RubyProf/DotPrinter.html">RubyProf::DotPrinter</a>
|
176
|
-
|
177
|
-
<li><a href="./RubyProf/FlatPrinter.html">RubyProf::FlatPrinter</a>
|
178
|
-
|
179
|
-
<li><a href="./RubyProf/FlatPrinterWithLineNumbers.html">RubyProf::FlatPrinterWithLineNumbers</a>
|
180
|
-
|
181
|
-
<li><a href="./RubyProf/GraphHtmlPrinter.html">RubyProf::GraphHtmlPrinter</a>
|
182
|
-
|
183
|
-
<li><a href="./RubyProf/GraphPrinter.html">RubyProf::GraphPrinter</a>
|
184
|
-
|
185
|
-
<li><a href="./RubyProf/MethodInfo.html">RubyProf::MethodInfo</a>
|
186
|
-
|
187
|
-
<li><a href="./RubyProf/MultiPrinter.html">RubyProf::MultiPrinter</a>
|
188
|
-
|
189
|
-
<li><a href="./RubyProf/Profile.html">RubyProf::Profile</a>
|
190
|
-
|
191
|
-
<li><a href="./RubyProf/ProfileTask.html">RubyProf::ProfileTask</a>
|
192
|
-
|
193
|
-
<li><a href="./RubyProf/Test.html">RubyProf::Test</a>
|
194
|
-
|
195
|
-
<li><a href="./RubyProf/Thread.html">RubyProf::Thread</a>
|
196
|
-
|
197
|
-
<li><a href="./Rack.html">Rack</a>
|
198
|
-
|
199
|
-
<li><a href="./Rack/RubyProf.html">Rack::RubyProf</a>
|
200
|
-
|
201
|
-
</ul>
|
202
|
-
</nav>
|
203
|
-
|
204
|
-
</div>
|
205
|
-
</nav>
|
206
|
-
|
207
|
-
<div id="documentation">
|
208
|
-
<h1 class="module">module RubyProf</h1>
|
209
|
-
|
210
|
-
<div id="description" class="description">
|
211
|
-
|
212
|
-
<p>The call info visitor class does a depth-first traversal across a
|
213
|
-
thread's call stack. At each call_info node, the visitor executes the
|
214
|
-
block provided in the visit method. The block is passed two parameters,
|
215
|
-
the event and the call_info instance. Event will be either :enter or
|
216
|
-
:exit.</p>
|
217
|
-
|
218
|
-
<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>)
|
219
|
-
|
220
|
-
<span class="ruby-identifier">method_names</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
221
|
-
|
222
|
-
<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>
|
223
|
-
<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>
|
224
|
-
<span class="ruby-keyword">end</span>
|
225
|
-
|
226
|
-
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">method_names</span>
|
227
|
-
</pre>
|
228
|
-
|
229
|
-
<p>These methods are here for backwards compatability with previous <a
|
230
|
-
href="RubyProf.html">RubyProf</a> releases</p>
|
231
|
-
|
232
|
-
</div><!-- description -->
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
<!-- Constants -->
|
244
|
-
<section id="constants-list" class="section">
|
245
|
-
<h3 class="section-header">Constants</h3>
|
246
|
-
<dl>
|
247
|
-
|
248
|
-
<dt id="VERSION">VERSION
|
249
|
-
|
250
|
-
<dd class="description">
|
251
|
-
|
252
|
-
|
253
|
-
</dl>
|
254
|
-
</section>
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
<!-- Methods -->
|
260
|
-
|
261
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
262
|
-
<h3 class="section-header">Public Class Methods</h3>
|
263
|
-
|
264
|
-
|
265
|
-
<div id="method-c-cpu_frequency" class="method-detail ">
|
266
|
-
|
267
|
-
<div class="method-heading">
|
268
|
-
<span class="method-name">cpu_frequency</span><span
|
269
|
-
class="method-args">()</span>
|
270
|
-
<span class="method-click-advice">click to toggle source</span>
|
271
|
-
</div>
|
272
|
-
|
273
|
-
|
274
|
-
<div class="method-description">
|
275
|
-
|
276
|
-
<p>Measurements</p>
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
<div class="method-source-code" id="cpu_frequency-source">
|
281
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 5</span>
|
282
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">cpu_frequency</span>
|
283
|
-
<span class="ruby-constant">Measure</span><span class="ruby-operator">::</span><span class="ruby-constant">CpuTime</span>.<span class="ruby-identifier">frequency</span>
|
284
|
-
<span class="ruby-keyword">end</span></pre>
|
285
|
-
</div><!-- cpu_frequency-source -->
|
286
|
-
|
287
|
-
</div>
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
</div><!-- cpu_frequency-method -->
|
293
|
-
|
294
|
-
|
295
|
-
<div id="method-c-cpu_frequency-3D" class="method-detail ">
|
296
|
-
|
297
|
-
<div class="method-heading">
|
298
|
-
<span class="method-name">cpu_frequency=</span><span
|
299
|
-
class="method-args">(value)</span>
|
300
|
-
<span class="method-click-advice">click to toggle source</span>
|
301
|
-
</div>
|
302
|
-
|
303
|
-
|
304
|
-
<div class="method-description">
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
<div class="method-source-code" id="cpu_frequency-3D-source">
|
311
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 9</span>
|
312
|
-
<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>)
|
313
|
-
<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>
|
314
|
-
<span class="ruby-keyword">end</span></pre>
|
315
|
-
</div><!-- cpu_frequency-3D-source -->
|
316
|
-
|
317
|
-
</div>
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
</div><!-- cpu_frequency-3D-method -->
|
323
|
-
|
324
|
-
|
325
|
-
<div id="method-c-exclude_threads" class="method-detail ">
|
326
|
-
|
327
|
-
|
328
|
-
<div class="method-heading">
|
329
|
-
<span class="method-callseq">
|
330
|
-
exclude_threads → exclude_threads
|
331
|
-
</span>
|
332
|
-
|
333
|
-
<span class="method-click-advice">click to toggle source</span>
|
334
|
-
|
335
|
-
</div>
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
<div class="method-description">
|
340
|
-
|
341
|
-
<p>Returns threads ruby-prof should exclude from profiling</p>
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
<div class="method-source-code" id="exclude_threads-source">
|
346
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 79</span>
|
347
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">exclude_threads</span>
|
348
|
-
<span class="ruby-ivar">@exclude_threads</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
349
|
-
<span class="ruby-keyword">end</span></pre>
|
350
|
-
</div><!-- exclude_threads-source -->
|
351
|
-
|
352
|
-
</div>
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
</div><!-- exclude_threads-method -->
|
358
|
-
|
359
|
-
|
360
|
-
<div id="method-c-exclude_threads-3D" class="method-detail ">
|
361
|
-
|
362
|
-
|
363
|
-
<div class="method-heading">
|
364
|
-
<span class="method-callseq">
|
365
|
-
exclude_threads= → void
|
366
|
-
</span>
|
367
|
-
|
368
|
-
<span class="method-click-advice">click to toggle source</span>
|
369
|
-
|
370
|
-
</div>
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
<div class="method-description">
|
375
|
-
|
376
|
-
<p>Specifies what threads ruby-prof should exclude from profiling</p>
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
<div class="method-source-code" id="exclude_threads-3D-source">
|
381
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 88</span>
|
382
|
-
<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>)
|
383
|
-
<span class="ruby-ivar">@exclude_threads</span> = <span class="ruby-identifier">value</span>
|
384
|
-
<span class="ruby-keyword">end</span></pre>
|
385
|
-
</div><!-- exclude_threads-3D-source -->
|
386
|
-
|
387
|
-
</div>
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
</div><!-- exclude_threads-3D-method -->
|
393
|
-
|
394
|
-
|
395
|
-
<div id="method-c-figure_measure_mode" class="method-detail ">
|
396
|
-
|
397
|
-
<div class="method-heading">
|
398
|
-
<span class="method-name">figure_measure_mode</span><span
|
399
|
-
class="method-args">()</span>
|
400
|
-
<span class="method-click-advice">click to toggle source</span>
|
401
|
-
</div>
|
402
|
-
|
403
|
-
|
404
|
-
<div class="method-description">
|
405
|
-
|
406
|
-
<p>Checks if the user specified the clock mode via the RUBY_PROF_MEASURE_MODE
|
407
|
-
environment variable</p>
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
<div class="method-source-code" id="figure_measure_mode-source">
|
412
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof.rb, line 33</span>
|
413
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">figure_measure_mode</span>
|
414
|
-
<span class="ruby-keyword">case</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">"RUBY_PROF_MEASURE_MODE"</span>]
|
415
|
-
<span class="ruby-keyword">when</span> <span class="ruby-string">"wall"</span> <span class="ruby-operator">||</span> <span class="ruby-string">"wall_time"</span>
|
416
|
-
<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>
|
417
|
-
<span class="ruby-keyword">when</span> <span class="ruby-string">"cpu"</span> <span class="ruby-operator">||</span> <span class="ruby-string">"cpu_time"</span>
|
418
|
-
<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>)
|
419
|
-
<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>
|
420
|
-
<span class="ruby-keyword">else</span>
|
421
|
-
<span class="ruby-keyword">begin</span>
|
422
|
-
<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>
|
423
|
-
<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>
|
424
|
-
<span class="ruby-identifier">s</span> = <span class="ruby-identifier">line</span>.<span class="ruby-identifier">slice</span>(<span class="ruby-regexp">%rcpu MHz\s*:\s*(.*)/</span>, <span class="ruby-value">1</span>)
|
425
|
-
<span class="ruby-keyword">if</span> <span class="ruby-identifier">s</span>
|
426
|
-
<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-value">1000000</span>
|
427
|
-
<span class="ruby-keyword">break</span>
|
428
|
-
<span class="ruby-keyword">end</span>
|
429
|
-
<span class="ruby-keyword">end</span>
|
430
|
-
<span class="ruby-keyword">end</span>
|
431
|
-
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ENOENT</span>
|
432
|
-
<span class="ruby-keyword">end</span>
|
433
|
-
<span class="ruby-keyword">end</span>
|
434
|
-
<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>
|
435
|
-
<span class="ruby-keyword">when</span> <span class="ruby-string">"allocations"</span>
|
436
|
-
<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>
|
437
|
-
<span class="ruby-keyword">when</span> <span class="ruby-string">"memory"</span>
|
438
|
-
<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>
|
439
|
-
<span class="ruby-keyword">else</span>
|
440
|
-
<span class="ruby-comment"># the default...</span>
|
441
|
-
<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>
|
442
|
-
<span class="ruby-keyword">end</span>
|
443
|
-
<span class="ruby-keyword">end</span></pre>
|
444
|
-
</div><!-- figure_measure_mode-source -->
|
445
|
-
|
446
|
-
</div>
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
</div><!-- figure_measure_mode-method -->
|
452
|
-
|
453
|
-
|
454
|
-
<div id="method-c-measure_allocations" class="method-detail ">
|
455
|
-
|
456
|
-
<div class="method-heading">
|
457
|
-
<span class="method-name">measure_allocations</span><span
|
458
|
-
class="method-args">()</span>
|
459
|
-
<span class="method-click-advice">click to toggle source</span>
|
460
|
-
</div>
|
461
|
-
|
462
|
-
|
463
|
-
<div class="method-description">
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
<div class="method-source-code" id="measure_allocations-source">
|
470
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 13</span>
|
471
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">measure_allocations</span>
|
472
|
-
<span class="ruby-constant">Measure</span><span class="ruby-operator">::</span><span class="ruby-constant">Allocations</span>.<span class="ruby-identifier">measure</span>
|
473
|
-
<span class="ruby-keyword">end</span></pre>
|
474
|
-
</div><!-- measure_allocations-source -->
|
475
|
-
|
476
|
-
</div>
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
</div><!-- measure_allocations-method -->
|
482
|
-
|
483
|
-
|
484
|
-
<div id="method-c-measure_cpu_time" class="method-detail ">
|
485
|
-
|
486
|
-
<div class="method-heading">
|
487
|
-
<span class="method-name">measure_cpu_time</span><span
|
488
|
-
class="method-args">()</span>
|
489
|
-
<span class="method-click-advice">click to toggle source</span>
|
490
|
-
</div>
|
491
|
-
|
492
|
-
|
493
|
-
<div class="method-description">
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
<div class="method-source-code" id="measure_cpu_time-source">
|
500
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 17</span>
|
501
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">measure_cpu_time</span>
|
502
|
-
<span class="ruby-constant">Measure</span><span class="ruby-operator">::</span><span class="ruby-constant">CpuTime</span>.<span class="ruby-identifier">measure</span>
|
503
|
-
<span class="ruby-keyword">end</span></pre>
|
504
|
-
</div><!-- measure_cpu_time-source -->
|
505
|
-
|
506
|
-
</div>
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
</div><!-- measure_cpu_time-method -->
|
512
|
-
|
513
|
-
|
514
|
-
<div id="method-c-measure_gc_runs" class="method-detail ">
|
515
|
-
|
516
|
-
<div class="method-heading">
|
517
|
-
<span class="method-name">measure_gc_runs</span><span
|
518
|
-
class="method-args">()</span>
|
519
|
-
<span class="method-click-advice">click to toggle source</span>
|
520
|
-
</div>
|
521
|
-
|
522
|
-
|
523
|
-
<div class="method-description">
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
<div class="method-source-code" id="measure_gc_runs-source">
|
530
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 21</span>
|
531
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">measure_gc_runs</span>
|
532
|
-
<span class="ruby-constant">Measure</span><span class="ruby-operator">::</span><span class="ruby-constant">GcRuns</span>.<span class="ruby-identifier">measure</span>
|
533
|
-
<span class="ruby-keyword">end</span></pre>
|
534
|
-
</div><!-- measure_gc_runs-source -->
|
535
|
-
|
536
|
-
</div>
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
</div><!-- measure_gc_runs-method -->
|
542
|
-
|
543
|
-
|
544
|
-
<div id="method-c-measure_gc_time" class="method-detail ">
|
545
|
-
|
546
|
-
<div class="method-heading">
|
547
|
-
<span class="method-name">measure_gc_time</span><span
|
548
|
-
class="method-args">()</span>
|
549
|
-
<span class="method-click-advice">click to toggle source</span>
|
550
|
-
</div>
|
551
|
-
|
552
|
-
|
553
|
-
<div class="method-description">
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
<div class="method-source-code" id="measure_gc_time-source">
|
560
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 25</span>
|
561
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">measure_gc_time</span>
|
562
|
-
<span class="ruby-constant">Measure</span><span class="ruby-operator">::</span><span class="ruby-constant">GcTime</span>.<span class="ruby-identifier">measure</span>
|
563
|
-
<span class="ruby-keyword">end</span></pre>
|
564
|
-
</div><!-- measure_gc_time-source -->
|
565
|
-
|
566
|
-
</div>
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
</div><!-- measure_gc_time-method -->
|
572
|
-
|
573
|
-
|
574
|
-
<div id="method-c-measure_memory" class="method-detail ">
|
575
|
-
|
576
|
-
<div class="method-heading">
|
577
|
-
<span class="method-name">measure_memory</span><span
|
578
|
-
class="method-args">()</span>
|
579
|
-
<span class="method-click-advice">click to toggle source</span>
|
580
|
-
</div>
|
581
|
-
|
582
|
-
|
583
|
-
<div class="method-description">
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
<div class="method-source-code" id="measure_memory-source">
|
590
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 29</span>
|
591
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">measure_memory</span>
|
592
|
-
<span class="ruby-constant">Measure</span><span class="ruby-operator">::</span><span class="ruby-constant">Memory</span>.<span class="ruby-identifier">measure</span>
|
593
|
-
<span class="ruby-keyword">end</span></pre>
|
594
|
-
</div><!-- measure_memory-source -->
|
595
|
-
|
596
|
-
</div>
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
</div><!-- measure_memory-method -->
|
602
|
-
|
603
|
-
|
604
|
-
<div id="method-c-measure_mode" class="method-detail ">
|
605
|
-
|
606
|
-
|
607
|
-
<div class="method-heading">
|
608
|
-
<span class="method-callseq">
|
609
|
-
measure_mode → measure_mode
|
610
|
-
</span>
|
611
|
-
|
612
|
-
<span class="method-click-advice">click to toggle source</span>
|
613
|
-
|
614
|
-
</div>
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
<div class="method-description">
|
619
|
-
|
620
|
-
<p>Returns what ruby-prof is measuring. Valid values include:</p>
|
621
|
-
|
622
|
-
<p>*RubyProf::PROCESS_TIME - Measure process time. This is default. It is
|
623
|
-
implemented using the clock functions in the C Runtime library.
|
624
|
-
*RubyProf::WALL_TIME - Measure wall time using gettimeofday on Linx and
|
625
|
-
GetLocalTime on Windows *RubyProf::CPU_TIME - Measure time using the CPU
|
626
|
-
clock counter. This mode is only supported on Pentium or PowerPC
|
627
|
-
platforms. *RubyProf::ALLOCATIONS - Measure object allocations. This
|
628
|
-
requires a patched Ruby interpreter. *RubyProf::MEMORY - Measure memory
|
629
|
-
size. This requires a patched Ruby interpreter. *RubyProf::GC_RUNS -
|
630
|
-
Measure number of garbage collections. This requires a patched Ruby
|
631
|
-
interpreter. *RubyProf::GC_TIME - Measure time spent doing garbage
|
632
|
-
collection. This requires a patched Ruby interpreter.*/</p>
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
<div class="method-source-code" id="measure_mode-source">
|
637
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 54</span>
|
638
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">measure_mode</span>
|
639
|
-
<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>
|
640
|
-
<span class="ruby-keyword">end</span></pre>
|
641
|
-
</div><!-- measure_mode-source -->
|
642
|
-
|
643
|
-
</div>
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
</div><!-- measure_mode-method -->
|
649
|
-
|
650
|
-
|
651
|
-
<div id="method-c-measure_mode-3D" class="method-detail ">
|
652
|
-
|
653
|
-
|
654
|
-
<div class="method-heading">
|
655
|
-
<span class="method-callseq">
|
656
|
-
measure_mode=value → void
|
657
|
-
</span>
|
658
|
-
|
659
|
-
<span class="method-click-advice">click to toggle source</span>
|
660
|
-
|
661
|
-
</div>
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
<div class="method-description">
|
666
|
-
|
667
|
-
<p>Specifies what ruby-prof should measure. Valid values include:</p>
|
668
|
-
|
669
|
-
<p>*RubyProf::PROCESS_TIME - Measure process time. This is default. It is
|
670
|
-
implemented using the clock functions in the C Runtime library.
|
671
|
-
*RubyProf::WALL_TIME - Measure wall time using gettimeofday on Linx and
|
672
|
-
GetLocalTime on Windows *RubyProf::CPU_TIME - Measure time using the CPU
|
673
|
-
clock counter. This mode is only supported on Pentium or PowerPC
|
674
|
-
platforms. *RubyProf::ALLOCATIONS - Measure object allocations. This
|
675
|
-
requires a patched Ruby interpreter. *RubyProf::MEMORY - Measure memory
|
676
|
-
size. This requires a patched Ruby interpreter. *RubyProf::GC_RUNS -
|
677
|
-
Measure number of garbage collections. This requires a patched Ruby
|
678
|
-
interpreter. *RubyProf::GC_TIME - Measure time spent doing garbage
|
679
|
-
collection. This requires a patched Ruby interpreter.*/</p>
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
<div class="method-source-code" id="measure_mode-3D-source">
|
684
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 70</span>
|
685
|
-
<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>)
|
686
|
-
<span class="ruby-ivar">@measure_mode</span> = <span class="ruby-identifier">value</span>
|
687
|
-
<span class="ruby-keyword">end</span></pre>
|
688
|
-
</div><!-- measure_mode-3D-source -->
|
689
|
-
|
690
|
-
</div>
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
</div><!-- measure_mode-3D-method -->
|
696
|
-
|
697
|
-
|
698
|
-
<div id="method-c-measure_process_time" class="method-detail ">
|
699
|
-
|
700
|
-
<div class="method-heading">
|
701
|
-
<span class="method-name">measure_process_time</span><span
|
702
|
-
class="method-args">()</span>
|
703
|
-
<span class="method-click-advice">click to toggle source</span>
|
704
|
-
</div>
|
705
|
-
|
706
|
-
|
707
|
-
<div class="method-description">
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
<div class="method-source-code" id="measure_process_time-source">
|
714
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 33</span>
|
715
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">measure_process_time</span>
|
716
|
-
<span class="ruby-constant">Measure</span><span class="ruby-operator">::</span><span class="ruby-constant">ProcessTime</span>.<span class="ruby-identifier">measure</span>
|
717
|
-
<span class="ruby-keyword">end</span></pre>
|
718
|
-
</div><!-- measure_process_time-source -->
|
719
|
-
|
720
|
-
</div>
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
</div><!-- measure_process_time-method -->
|
726
|
-
|
727
|
-
|
728
|
-
<div id="method-c-measure_wall_time" class="method-detail ">
|
729
|
-
|
730
|
-
<div class="method-heading">
|
731
|
-
<span class="method-name">measure_wall_time</span><span
|
732
|
-
class="method-args">()</span>
|
733
|
-
<span class="method-click-advice">click to toggle source</span>
|
734
|
-
</div>
|
735
|
-
|
736
|
-
|
737
|
-
<div class="method-description">
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
<div class="method-source-code" id="measure_wall_time-source">
|
744
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 37</span>
|
745
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">measure_wall_time</span>
|
746
|
-
<span class="ruby-constant">Measure</span><span class="ruby-operator">::</span><span class="ruby-constant">WallTime</span>.<span class="ruby-identifier">measure</span>
|
747
|
-
<span class="ruby-keyword">end</span></pre>
|
748
|
-
</div><!-- measure_wall_time-source -->
|
749
|
-
|
750
|
-
</div>
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
</div><!-- measure_wall_time-method -->
|
756
|
-
|
757
|
-
|
758
|
-
<div id="method-c-pause" class="method-detail ">
|
759
|
-
|
760
|
-
<div class="method-heading">
|
761
|
-
<span class="method-name">pause</span><span
|
762
|
-
class="method-args">()</span>
|
763
|
-
<span class="method-click-advice">click to toggle source</span>
|
764
|
-
</div>
|
765
|
-
|
766
|
-
|
767
|
-
<div class="method-description">
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
<div class="method-source-code" id="pause-source">
|
774
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 105</span>
|
775
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">pause</span>
|
776
|
-
<span class="ruby-identifier">ensure_running!</span>
|
777
|
-
<span class="ruby-identifier">disable_gc_stats_if_needed</span>
|
778
|
-
<span class="ruby-ivar">@profile</span>.<span class="ruby-identifier">pause</span>
|
779
|
-
<span class="ruby-keyword">end</span></pre>
|
780
|
-
</div><!-- pause-source -->
|
781
|
-
|
782
|
-
</div>
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
</div><!-- pause-method -->
|
788
|
-
|
789
|
-
|
790
|
-
<div id="method-c-profile" class="method-detail ">
|
791
|
-
|
792
|
-
<div class="method-heading">
|
793
|
-
<span class="method-name">profile</span><span
|
794
|
-
class="method-args">(&block)</span>
|
795
|
-
<span class="method-click-advice">click to toggle source</span>
|
796
|
-
</div>
|
797
|
-
|
798
|
-
|
799
|
-
<div class="method-description">
|
800
|
-
|
801
|
-
<p><a href="RubyProf/Profile.html">Profile</a> a block</p>
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
<div class="method-source-code" id="profile-source">
|
806
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 134</span>
|
807
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">profile</span>(&<span class="ruby-identifier">block</span>)
|
808
|
-
<span class="ruby-identifier">ensure_not_running!</span>
|
809
|
-
<span class="ruby-identifier">gc_stat_was_enabled</span> = <span class="ruby-identifier">enable_gc_stats_if_needed</span>
|
810
|
-
<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-identifier">block</span>)
|
811
|
-
<span class="ruby-identifier">disable_gc_stats_if_needed</span>(<span class="ruby-identifier">gc_stat_was_enabled</span>)
|
812
|
-
<span class="ruby-identifier">res</span>
|
813
|
-
<span class="ruby-keyword">end</span></pre>
|
814
|
-
</div><!-- profile-source -->
|
815
|
-
|
816
|
-
</div>
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
</div><!-- profile-method -->
|
822
|
-
|
823
|
-
|
824
|
-
<div id="method-c-resume" class="method-detail ">
|
825
|
-
|
826
|
-
<div class="method-heading">
|
827
|
-
<span class="method-name">resume</span><span
|
828
|
-
class="method-args">()</span>
|
829
|
-
<span class="method-click-advice">click to toggle source</span>
|
830
|
-
</div>
|
831
|
-
|
832
|
-
|
833
|
-
<div class="method-description">
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
<div class="method-source-code" id="resume-source">
|
840
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 119</span>
|
841
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">resume</span>
|
842
|
-
<span class="ruby-identifier">ensure_running!</span>
|
843
|
-
<span class="ruby-identifier">enable_gc_stats_if_needed</span>
|
844
|
-
<span class="ruby-ivar">@profile</span>.<span class="ruby-identifier">resume</span>
|
845
|
-
<span class="ruby-keyword">end</span></pre>
|
846
|
-
</div><!-- resume-source -->
|
847
|
-
|
848
|
-
</div>
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
</div><!-- resume-method -->
|
854
|
-
|
855
|
-
|
856
|
-
<div id="method-c-running-3F" class="method-detail ">
|
857
|
-
|
858
|
-
<div class="method-heading">
|
859
|
-
<span class="method-name">running?</span><span
|
860
|
-
class="method-args">()</span>
|
861
|
-
<span class="method-click-advice">click to toggle source</span>
|
862
|
-
</div>
|
863
|
-
|
864
|
-
|
865
|
-
<div class="method-description">
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
<div class="method-source-code" id="running-3F-source">
|
872
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 111</span>
|
873
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">running?</span>
|
874
|
-
<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>
|
875
|
-
<span class="ruby-ivar">@profile</span>.<span class="ruby-identifier">running?</span>
|
876
|
-
<span class="ruby-keyword">else</span>
|
877
|
-
<span class="ruby-keyword">false</span>
|
878
|
-
<span class="ruby-keyword">end</span>
|
879
|
-
<span class="ruby-keyword">end</span></pre>
|
880
|
-
</div><!-- running-3F-source -->
|
881
|
-
|
882
|
-
</div>
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
</div><!-- running-3F-method -->
|
888
|
-
|
889
|
-
|
890
|
-
<div id="method-c-start" class="method-detail ">
|
891
|
-
|
892
|
-
<div class="method-heading">
|
893
|
-
<span class="method-name">start</span><span
|
894
|
-
class="method-args">()</span>
|
895
|
-
<span class="method-click-advice">click to toggle source</span>
|
896
|
-
</div>
|
897
|
-
|
898
|
-
|
899
|
-
<div class="method-description">
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
<div class="method-source-code" id="start-source">
|
906
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 98</span>
|
907
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">start</span>
|
908
|
-
<span class="ruby-identifier">ensure_not_running!</span>
|
909
|
-
<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>)
|
910
|
-
<span class="ruby-identifier">enable_gc_stats_if_needed</span>
|
911
|
-
<span class="ruby-ivar">@profile</span>.<span class="ruby-identifier">start</span>
|
912
|
-
<span class="ruby-keyword">end</span></pre>
|
913
|
-
</div><!-- start-source -->
|
914
|
-
|
915
|
-
</div>
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
</div><!-- start-method -->
|
921
|
-
|
922
|
-
|
923
|
-
<div id="method-c-start_script" class="method-detail ">
|
924
|
-
|
925
|
-
<div class="method-heading">
|
926
|
-
<span class="method-name">start_script</span><span
|
927
|
-
class="method-args">(script)</span>
|
928
|
-
<span class="method-click-advice">click to toggle source</span>
|
929
|
-
</div>
|
930
|
-
|
931
|
-
|
932
|
-
<div class="method-description">
|
933
|
-
|
934
|
-
<p>Profiling</p>
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
<div class="method-source-code" id="start_script-source">
|
939
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 93</span>
|
940
|
-
<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>)
|
941
|
-
<span class="ruby-identifier">start</span>
|
942
|
-
<span class="ruby-identifier">load</span> <span class="ruby-identifier">script</span>
|
943
|
-
<span class="ruby-keyword">end</span></pre>
|
944
|
-
</div><!-- start_script-source -->
|
945
|
-
|
946
|
-
</div>
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
</div><!-- start_script-method -->
|
952
|
-
|
953
|
-
|
954
|
-
<div id="method-c-stop" class="method-detail ">
|
955
|
-
|
956
|
-
<div class="method-heading">
|
957
|
-
<span class="method-name">stop</span><span
|
958
|
-
class="method-args">()</span>
|
959
|
-
<span class="method-click-advice">click to toggle source</span>
|
960
|
-
</div>
|
961
|
-
|
962
|
-
|
963
|
-
<div class="method-description">
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
<div class="method-source-code" id="stop-source">
|
970
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/compatibility.rb, line 125</span>
|
971
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">stop</span>
|
972
|
-
<span class="ruby-identifier">ensure_running!</span>
|
973
|
-
<span class="ruby-identifier">result</span> = <span class="ruby-ivar">@profile</span>.<span class="ruby-identifier">stop</span>
|
974
|
-
<span class="ruby-identifier">disable_gc_stats_if_needed</span>
|
975
|
-
<span class="ruby-ivar">@profile</span> = <span class="ruby-keyword">nil</span>
|
976
|
-
<span class="ruby-identifier">result</span>
|
977
|
-
<span class="ruby-keyword">end</span></pre>
|
978
|
-
</div><!-- stop-source -->
|
979
|
-
|
980
|
-
</div>
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
</div><!-- stop-method -->
|
986
|
-
|
987
|
-
|
988
|
-
</section><!-- public-class-method-details -->
|
989
|
-
|
990
|
-
</section><!-- 5Buntitled-5D -->
|
991
|
-
|
992
|
-
</div><!-- documentation -->
|
993
|
-
|
994
|
-
|
995
|
-
<footer id="validator-badges">
|
996
|
-
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
997
|
-
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
|
998
|
-
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
999
|
-
</footer>
|
1000
|
-
|