ruby-prof 0.13.1 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +14 -0
- data/README.rdoc +1 -1
- data/Rakefile +2 -3
- data/bin/ruby-prof +4 -4
- data/bin/ruby-prof-check-trace +45 -0
- data/doc/LICENSE.html +49 -88
- data/doc/README_rdoc.html +92 -106
- data/doc/Rack.html +47 -116
- data/doc/Rack/RubyProf.html +119 -174
- data/doc/RubyProf.html +184 -216
- data/doc/RubyProf/AbstractPrinter.html +131 -162
- data/doc/RubyProf/AggregateCallInfo.html +136 -166
- data/doc/RubyProf/CallInfo.html +113 -154
- data/doc/RubyProf/CallInfoPrinter.html +56 -123
- data/doc/RubyProf/CallInfoVisitor.html +87 -216
- data/doc/RubyProf/CallStackPrinter.html +222 -215
- data/doc/RubyProf/CallTreePrinter.html +91 -142
- data/doc/RubyProf/Cmd.html +115 -157
- data/doc/RubyProf/DotPrinter.html +88 -140
- data/doc/RubyProf/FlatPrinter.html +66 -129
- data/doc/RubyProf/FlatPrinterWithLineNumbers.html +69 -132
- data/doc/RubyProf/GraphHtmlPrinter.html +115 -166
- data/doc/RubyProf/GraphPrinter.html +58 -125
- data/doc/RubyProf/MethodInfo.html +147 -172
- data/doc/RubyProf/MultiPrinter.html +104 -150
- data/doc/RubyProf/Profile.html +125 -179
- data/doc/RubyProf/ProfileTask.html +117 -157
- data/doc/RubyProf/Test.html +115 -154
- data/doc/RubyProf/Thread.html +87 -147
- data/doc/created.rid +13 -14
- data/doc/examples/flat_txt.html +51 -90
- data/doc/examples/graph_html.html +852 -0
- data/doc/examples/graph_txt.html +64 -92
- data/doc/fonts.css +167 -0
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/index.html +75 -65
- data/doc/js/darkfish.js +0 -15
- data/doc/js/search.js +20 -5
- data/doc/js/search_index.js +1 -1
- data/doc/rdoc.css +255 -218
- data/doc/table_of_contents.html +751 -353
- data/ext/ruby_prof/extconf.rb +20 -22
- data/ext/ruby_prof/rp_measure_allocations.c +9 -5
- data/ext/ruby_prof/rp_measure_gc_runs.c +8 -0
- data/ext/ruby_prof/rp_measure_gc_time.c +5 -2
- data/ext/ruby_prof/rp_measure_wall_time.c +1 -0
- data/ext/ruby_prof/rp_method.c +0 -9
- data/ext/ruby_prof/rp_method.h +1 -6
- data/ext/ruby_prof/ruby_prof.c +32 -112
- data/ext/ruby_prof/ruby_prof.h +9 -10
- data/lib/ruby-prof.rb +2 -1
- data/lib/ruby-prof/aggregate_call_info.rb +4 -6
- data/lib/ruby-prof/call_info_visitor.rb +42 -44
- data/lib/ruby-prof/printers/graph_html_printer.rb +0 -8
- data/lib/ruby-prof/profile.rb +4 -4
- data/lib/ruby-prof/rack.rb +47 -47
- data/lib/ruby-prof/task.rb +0 -0
- data/lib/ruby-prof/thread.rb +22 -22
- data/lib/ruby-prof/version.rb +3 -0
- data/ruby-prof.gemspec +7 -11
- data/test/call_info_test.rb +78 -78
- data/test/call_info_visitor_test.rb +31 -31
- data/test/fiber_test.rb +2 -2
- data/test/measure_gc_runs_test.rb +1 -1
- data/test/measure_process_time_test.rb +7 -6
- data/test/printers_test.rb +4 -8
- data/test/recursive_test.rb +5 -9
- data/test/test_helper.rb +1 -1
- data/test/unique_call_path_test.rb +7 -29
- data/test/yarv_test.rb +55 -0
- metadata +63 -55
- data/ext/ruby_prof/version.h +0 -7
- data/lib/ruby-prof/test.rb +0 -150
- data/test/exec_test.rb +0 -14
- data/test/test_suite.rb +0 -37
@@ -2,157 +2,91 @@
|
|
2
2
|
|
3
3
|
<html>
|
4
4
|
<head>
|
5
|
-
<meta
|
5
|
+
<meta charset="UTF-8">
|
6
6
|
|
7
7
|
<title>class RubyProf::FlatPrinterWithLineNumbers - ruby-prof</title>
|
8
8
|
|
9
|
-
<link
|
9
|
+
<link href="../fonts.css" rel="stylesheet">
|
10
|
+
<link href="../rdoc.css" rel="stylesheet">
|
10
11
|
|
11
12
|
<script type="text/javascript">
|
12
13
|
var rdoc_rel_prefix = "../";
|
13
14
|
</script>
|
14
15
|
|
15
|
-
<script
|
16
|
-
<script
|
17
|
-
<script
|
18
|
-
<script
|
19
|
-
<script
|
20
|
-
<script
|
16
|
+
<script src="../js/jquery.js"></script>
|
17
|
+
<script src="../js/navigation.js"></script>
|
18
|
+
<script src="../js/search_index.js"></script>
|
19
|
+
<script src="../js/search.js"></script>
|
20
|
+
<script src="../js/searcher.js"></script>
|
21
|
+
<script src="../js/darkfish.js"></script>
|
21
22
|
|
22
23
|
|
23
|
-
<body id="top" class="class">
|
24
|
-
<nav
|
25
|
-
<
|
26
|
-
|
27
|
-
|
24
|
+
<body id="top" role="document" class="class">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
28
34
|
<a href="../table_of_contents.html#classes">Classes</a>
|
29
35
|
<a href="../table_of_contents.html#methods">Methods</a>
|
30
|
-
</
|
31
|
-
</
|
32
|
-
|
36
|
+
</div>
|
37
|
+
</div>
|
33
38
|
|
34
|
-
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
35
40
|
<form action="#" method="get" accept-charset="utf-8">
|
36
|
-
<
|
37
|
-
<input
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
38
45
|
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
-
</
|
40
|
-
</form>
|
41
|
-
|
42
|
-
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
-
</nav>
|
44
|
-
|
46
|
+
</div>
|
45
47
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
</ul>
|
52
|
-
</nav>
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
53
|
|
54
|
-
|
55
54
|
</div>
|
56
55
|
|
56
|
+
|
57
|
+
|
57
58
|
<div id="class-metadata">
|
58
59
|
|
59
|
-
<
|
60
|
-
<h3
|
60
|
+
<div id="parent-class-section" class="nav-section">
|
61
|
+
<h3>Parent</h3>
|
62
|
+
|
61
63
|
|
62
64
|
<p class="link"><a href="FlatPrinter.html">RubyProf::FlatPrinter</a>
|
63
65
|
|
64
|
-
</
|
66
|
+
</div>
|
65
67
|
|
66
68
|
|
69
|
+
|
67
70
|
<!-- Method Quickref -->
|
68
|
-
<
|
69
|
-
<h3
|
71
|
+
<div id="method-list-section" class="nav-section">
|
72
|
+
<h3>Methods</h3>
|
70
73
|
|
71
|
-
<ul class="link-list">
|
74
|
+
<ul class="link-list" role="directory">
|
72
75
|
|
73
|
-
<li><a href="#method-i-print_methods">#print_methods</a>
|
76
|
+
<li ><a href="#method-i-print_methods">#print_methods</a>
|
74
77
|
|
75
78
|
</ul>
|
76
|
-
</
|
77
|
-
|
78
|
-
</div>
|
79
|
-
|
80
|
-
<div id="project-metadata">
|
81
|
-
<nav id="fileindex-section" class="section project-section">
|
82
|
-
<h3 class="section-header">Pages</h3>
|
83
|
-
|
84
|
-
<ul>
|
85
|
-
|
86
|
-
<li class="file"><a href="../LICENSE.html">LICENSE</a>
|
87
|
-
|
88
|
-
<li class="file"><a href="../README_rdoc.html">README</a>
|
89
|
-
|
90
|
-
<li class="file"><a href="../examples/flat_txt.html">flat</a>
|
91
|
-
|
92
|
-
<li class="file"><a href="../examples/graph_txt.html">graph</a>
|
93
|
-
|
94
|
-
</ul>
|
95
|
-
</nav>
|
96
|
-
|
97
|
-
<nav id="classindex-section" class="section project-section">
|
98
|
-
<h3 class="section-header">Class and Module Index</h3>
|
99
|
-
|
100
|
-
<ul class="link-list">
|
101
|
-
|
102
|
-
<li><a href="../RubyProf.html">RubyProf</a>
|
103
|
-
|
104
|
-
<li><a href="../RubyProf/AbstractPrinter.html">RubyProf::AbstractPrinter</a>
|
105
|
-
|
106
|
-
<li><a href="../RubyProf/AggregateCallInfo.html">RubyProf::AggregateCallInfo</a>
|
107
|
-
|
108
|
-
<li><a href="../RubyProf/CallInfo.html">RubyProf::CallInfo</a>
|
109
|
-
|
110
|
-
<li><a href="../RubyProf/CallInfoPrinter.html">RubyProf::CallInfoPrinter</a>
|
111
|
-
|
112
|
-
<li><a href="../RubyProf/CallInfoVisitor.html">RubyProf::CallInfoVisitor</a>
|
113
|
-
|
114
|
-
<li><a href="../RubyProf/CallStackPrinter.html">RubyProf::CallStackPrinter</a>
|
115
|
-
|
116
|
-
<li><a href="../RubyProf/CallTreePrinter.html">RubyProf::CallTreePrinter</a>
|
117
|
-
|
118
|
-
<li><a href="../RubyProf/Cmd.html">RubyProf::Cmd</a>
|
119
|
-
|
120
|
-
<li><a href="../RubyProf/DotPrinter.html">RubyProf::DotPrinter</a>
|
121
|
-
|
122
|
-
<li><a href="../RubyProf/FlatPrinter.html">RubyProf::FlatPrinter</a>
|
123
|
-
|
124
|
-
<li><a href="../RubyProf/FlatPrinterWithLineNumbers.html">RubyProf::FlatPrinterWithLineNumbers</a>
|
125
|
-
|
126
|
-
<li><a href="../RubyProf/GraphHtmlPrinter.html">RubyProf::GraphHtmlPrinter</a>
|
127
|
-
|
128
|
-
<li><a href="../RubyProf/GraphPrinter.html">RubyProf::GraphPrinter</a>
|
129
|
-
|
130
|
-
<li><a href="../RubyProf/MethodInfo.html">RubyProf::MethodInfo</a>
|
131
|
-
|
132
|
-
<li><a href="../RubyProf/MultiPrinter.html">RubyProf::MultiPrinter</a>
|
133
|
-
|
134
|
-
<li><a href="../RubyProf/Profile.html">RubyProf::Profile</a>
|
135
|
-
|
136
|
-
<li><a href="../RubyProf/ProfileTask.html">RubyProf::ProfileTask</a>
|
137
|
-
|
138
|
-
<li><a href="../RubyProf/Test.html">RubyProf::Test</a>
|
139
|
-
|
140
|
-
<li><a href="../RubyProf/Thread.html">RubyProf::Thread</a>
|
141
|
-
|
142
|
-
<li><a href="../Rack.html">Rack</a>
|
143
|
-
|
144
|
-
<li><a href="../Rack/RubyProf.html">Rack::RubyProf</a>
|
145
|
-
|
146
|
-
</ul>
|
147
|
-
</nav>
|
79
|
+
</div>
|
148
80
|
|
149
81
|
</div>
|
150
82
|
</nav>
|
151
83
|
|
152
|
-
<
|
153
|
-
<h1
|
84
|
+
<main role="main" aria-labelledby="class-RubyProf::FlatPrinterWithLineNumbers">
|
85
|
+
<h1 id="class-RubyProf::FlatPrinterWithLineNumbers" class="class">
|
86
|
+
class RubyProf::FlatPrinterWithLineNumbers
|
87
|
+
</h1>
|
154
88
|
|
155
|
-
<
|
89
|
+
<section class="description">
|
156
90
|
|
157
91
|
<p>Generates <a href="../files/examples/flat_txt.html">flat</a> profile
|
158
92
|
reports as text. To use the flat printer with line numbers:</p>
|
@@ -164,7 +98,7 @@ end
|
|
164
98
|
printer = RubyProf::FlatPrinterWithLineNumbers.new(result)
|
165
99
|
printer.print(STDOUT, {})</pre>
|
166
100
|
|
167
|
-
</
|
101
|
+
</section>
|
168
102
|
|
169
103
|
|
170
104
|
|
@@ -178,10 +112,11 @@ printer.print(STDOUT, {})</pre>
|
|
178
112
|
|
179
113
|
|
180
114
|
|
181
|
-
<!-- Methods -->
|
182
115
|
|
183
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section
|
184
|
-
|
116
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
117
|
+
<header>
|
118
|
+
<h3>Public Instance Methods</h3>
|
119
|
+
</header>
|
185
120
|
|
186
121
|
|
187
122
|
<div id="method-i-print_methods" class="method-detail ">
|
@@ -189,7 +124,9 @@ printer.print(STDOUT, {})</pre>
|
|
189
124
|
<div class="method-heading">
|
190
125
|
<span class="method-name">print_methods</span><span
|
191
126
|
class="method-args">(thread)</span>
|
127
|
+
|
192
128
|
<span class="method-click-advice">click to toggle source</span>
|
129
|
+
|
193
130
|
</div>
|
194
131
|
|
195
132
|
|
@@ -197,6 +134,7 @@ printer.print(STDOUT, {})</pre>
|
|
197
134
|
|
198
135
|
|
199
136
|
|
137
|
+
|
200
138
|
|
201
139
|
|
202
140
|
<div class="method-source-code" id="print_methods-source">
|
@@ -204,10 +142,10 @@ printer.print(STDOUT, {})</pre>
|
|
204
142
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print_methods</span>(<span class="ruby-identifier">thread</span>)
|
205
143
|
<span class="ruby-identifier">total_time</span> = <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">total_time</span>
|
206
144
|
|
207
|
-
<span class="ruby-identifier">methods</span> = <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">methods</span>.<span class="ruby-identifier">sort_by</span>(
|
145
|
+
<span class="ruby-identifier">methods</span> = <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">methods</span>.<span class="ruby-identifier">sort_by</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">sort_method</span>).<span class="ruby-identifier">reverse</span>
|
208
146
|
<span class="ruby-identifier">sum</span> = <span class="ruby-value">0</span>
|
209
147
|
<span class="ruby-identifier">methods</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">method</span><span class="ruby-operator">|</span>
|
210
|
-
<span class="ruby-identifier">self_percent</span> = (<span class="ruby-identifier">method</span>.<span class="ruby-identifier">self_time</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">total_time</span>)
|
148
|
+
<span class="ruby-identifier">self_percent</span> = (<span class="ruby-identifier">method</span>.<span class="ruby-identifier">self_time</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">total_time</span>) <span class="ruby-operator">*</span> <span class="ruby-value">100</span>
|
211
149
|
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">self_percent</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">min_percent</span>
|
212
150
|
|
213
151
|
<span class="ruby-identifier">sum</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">self_time</span>
|
@@ -215,7 +153,7 @@ printer.print(STDOUT, {})</pre>
|
|
215
153
|
<span class="ruby-comment">#total_time_called = method.called > 0? method.total_time/method.called : 0</span>
|
216
154
|
|
217
155
|
<span class="ruby-ivar">@output</span> <span class="ruby-operator"><<</span> <span class="ruby-string">"%6.2f %9.3f %9.3f %9.3f %9.3f %8d %s%s \n"</span> <span class="ruby-operator">%</span> [
|
218
|
-
<span class="ruby-identifier">method</span>.<span class="ruby-identifier">self_time</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">total_time</span>
|
156
|
+
<span class="ruby-identifier">method</span>.<span class="ruby-identifier">self_time</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">total_time</span> <span class="ruby-operator">*</span> <span class="ruby-value">100</span>, <span class="ruby-comment"># %self</span>
|
219
157
|
<span class="ruby-identifier">method</span>.<span class="ruby-identifier">total_time</span>, <span class="ruby-comment"># total</span>
|
220
158
|
<span class="ruby-identifier">method</span>.<span class="ruby-identifier">self_time</span>, <span class="ruby-comment"># self</span>
|
221
159
|
<span class="ruby-identifier">method</span>.<span class="ruby-identifier">wait_time</span>, <span class="ruby-comment"># wait</span>
|
@@ -242,26 +180,25 @@ printer.print(STDOUT, {})</pre>
|
|
242
180
|
<span class="ruby-ivar">@output</span> <span class="ruby-operator"><<</span> <span class="ruby-string">"\n\n"</span>
|
243
181
|
<span class="ruby-keyword">end</span>
|
244
182
|
<span class="ruby-keyword">end</span></pre>
|
245
|
-
</div
|
183
|
+
</div>
|
246
184
|
|
247
185
|
</div>
|
248
186
|
|
249
187
|
|
250
188
|
|
251
189
|
|
252
|
-
</div
|
190
|
+
</div>
|
253
191
|
|
254
192
|
|
255
|
-
</section
|
193
|
+
</section>
|
256
194
|
|
257
|
-
</section
|
258
|
-
|
259
|
-
</div><!-- documentation -->
|
195
|
+
</section>
|
196
|
+
</main>
|
260
197
|
|
261
198
|
|
262
|
-
<footer id="validator-badges">
|
263
|
-
<p><a href="http://validator.w3.org/check/referer">
|
264
|
-
<p>Generated by <a href="
|
265
|
-
<p>
|
199
|
+
<footer id="validator-badges" role="contentinfo">
|
200
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
201
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
202
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
266
203
|
</footer>
|
267
204
|
|
@@ -2,70 +2,71 @@
|
|
2
2
|
|
3
3
|
<html>
|
4
4
|
<head>
|
5
|
-
<meta
|
5
|
+
<meta charset="UTF-8">
|
6
6
|
|
7
7
|
<title>class RubyProf::GraphHtmlPrinter - ruby-prof</title>
|
8
8
|
|
9
|
-
<link
|
9
|
+
<link href="../fonts.css" rel="stylesheet">
|
10
|
+
<link href="../rdoc.css" rel="stylesheet">
|
10
11
|
|
11
12
|
<script type="text/javascript">
|
12
13
|
var rdoc_rel_prefix = "../";
|
13
14
|
</script>
|
14
15
|
|
15
|
-
<script
|
16
|
-
<script
|
17
|
-
<script
|
18
|
-
<script
|
19
|
-
<script
|
20
|
-
<script
|
16
|
+
<script src="../js/jquery.js"></script>
|
17
|
+
<script src="../js/navigation.js"></script>
|
18
|
+
<script src="../js/search_index.js"></script>
|
19
|
+
<script src="../js/search.js"></script>
|
20
|
+
<script src="../js/searcher.js"></script>
|
21
|
+
<script src="../js/darkfish.js"></script>
|
21
22
|
|
22
23
|
|
23
|
-
<body id="top" class="class">
|
24
|
-
<nav
|
25
|
-
<
|
26
|
-
|
27
|
-
|
24
|
+
<body id="top" role="document" class="class">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
28
34
|
<a href="../table_of_contents.html#classes">Classes</a>
|
29
35
|
<a href="../table_of_contents.html#methods">Methods</a>
|
30
|
-
</
|
31
|
-
</
|
32
|
-
|
36
|
+
</div>
|
37
|
+
</div>
|
33
38
|
|
34
|
-
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
35
40
|
<form action="#" method="get" accept-charset="utf-8">
|
36
|
-
<
|
37
|
-
<input
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
38
45
|
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
-
</
|
40
|
-
</form>
|
46
|
+
</div>
|
41
47
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
<nav id="file-list-section" class="section">
|
48
|
-
<h3 class="section-header">Defined In</h3>
|
49
|
-
<ul>
|
50
|
-
<li>lib/ruby-prof/printers/graph_html_printer.rb
|
51
|
-
</ul>
|
52
|
-
</nav>
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
53
|
|
54
|
-
|
55
54
|
</div>
|
56
55
|
|
56
|
+
|
57
|
+
|
57
58
|
<div id="class-metadata">
|
58
59
|
|
59
|
-
<
|
60
|
-
<h3
|
60
|
+
<div id="parent-class-section" class="nav-section">
|
61
|
+
<h3>Parent</h3>
|
62
|
+
|
61
63
|
|
62
64
|
<p class="link"><a href="AbstractPrinter.html">RubyProf::AbstractPrinter</a>
|
63
65
|
|
64
|
-
</
|
66
|
+
</div>
|
65
67
|
|
66
|
-
|
67
|
-
<
|
68
|
-
<h3 class="section-header">Included Modules</h3>
|
68
|
+
<div id="includes-section" class="nav-section">
|
69
|
+
<h3>Included Modules</h3>
|
69
70
|
|
70
71
|
<ul class="link-list">
|
71
72
|
|
@@ -74,107 +75,39 @@
|
|
74
75
|
|
75
76
|
|
76
77
|
</ul>
|
77
|
-
</
|
78
|
+
</div>
|
78
79
|
|
80
|
+
|
79
81
|
<!-- Method Quickref -->
|
80
|
-
<
|
81
|
-
<h3
|
82
|
+
<div id="method-list-section" class="nav-section">
|
83
|
+
<h3>Methods</h3>
|
82
84
|
|
83
|
-
<ul class="link-list">
|
85
|
+
<ul class="link-list" role="directory">
|
84
86
|
|
85
|
-
<li><a href="#method-i-create_link">#create_link</a>
|
87
|
+
<li ><a href="#method-i-create_link">#create_link</a>
|
86
88
|
|
87
|
-
<li><a href="#method-i-file_link">#file_link</a>
|
89
|
+
<li ><a href="#method-i-file_link">#file_link</a>
|
88
90
|
|
89
|
-
<li><a href="#method-i-method_href">#method_href</a>
|
91
|
+
<li ><a href="#method-i-method_href">#method_href</a>
|
90
92
|
|
91
|
-
<li><a href="#method-i-print">#print</a>
|
93
|
+
<li ><a href="#method-i-print">#print</a>
|
92
94
|
|
93
|
-
<li><a href="#method-i-setup_options">#setup_options</a>
|
95
|
+
<li class="calls-super" ><a href="#method-i-setup_options">#setup_options</a>
|
94
96
|
|
95
|
-
<li><a href="#method-i-template">#template</a>
|
97
|
+
<li ><a href="#method-i-template">#template</a>
|
96
98
|
|
97
99
|
</ul>
|
98
|
-
</
|
100
|
+
</div>
|
99
101
|
|
100
102
|
</div>
|
101
|
-
|
102
|
-
<div id="project-metadata">
|
103
|
-
<nav id="fileindex-section" class="section project-section">
|
104
|
-
<h3 class="section-header">Pages</h3>
|
105
|
-
|
106
|
-
<ul>
|
107
|
-
|
108
|
-
<li class="file"><a href="../LICENSE.html">LICENSE</a>
|
109
|
-
|
110
|
-
<li class="file"><a href="../README_rdoc.html">README</a>
|
111
|
-
|
112
|
-
<li class="file"><a href="../examples/flat_txt.html">flat</a>
|
113
|
-
|
114
|
-
<li class="file"><a href="../examples/graph_txt.html">graph</a>
|
115
|
-
|
116
|
-
</ul>
|
117
103
|
</nav>
|
118
104
|
|
119
|
-
|
120
|
-
<
|
105
|
+
<main role="main" aria-labelledby="class-RubyProf::GraphHtmlPrinter">
|
106
|
+
<h1 id="class-RubyProf::GraphHtmlPrinter" class="class">
|
107
|
+
class RubyProf::GraphHtmlPrinter
|
108
|
+
</h1>
|
121
109
|
|
122
|
-
<
|
123
|
-
|
124
|
-
<li><a href="../RubyProf.html">RubyProf</a>
|
125
|
-
|
126
|
-
<li><a href="../RubyProf/AbstractPrinter.html">RubyProf::AbstractPrinter</a>
|
127
|
-
|
128
|
-
<li><a href="../RubyProf/AggregateCallInfo.html">RubyProf::AggregateCallInfo</a>
|
129
|
-
|
130
|
-
<li><a href="../RubyProf/CallInfo.html">RubyProf::CallInfo</a>
|
131
|
-
|
132
|
-
<li><a href="../RubyProf/CallInfoPrinter.html">RubyProf::CallInfoPrinter</a>
|
133
|
-
|
134
|
-
<li><a href="../RubyProf/CallInfoVisitor.html">RubyProf::CallInfoVisitor</a>
|
135
|
-
|
136
|
-
<li><a href="../RubyProf/CallStackPrinter.html">RubyProf::CallStackPrinter</a>
|
137
|
-
|
138
|
-
<li><a href="../RubyProf/CallTreePrinter.html">RubyProf::CallTreePrinter</a>
|
139
|
-
|
140
|
-
<li><a href="../RubyProf/Cmd.html">RubyProf::Cmd</a>
|
141
|
-
|
142
|
-
<li><a href="../RubyProf/DotPrinter.html">RubyProf::DotPrinter</a>
|
143
|
-
|
144
|
-
<li><a href="../RubyProf/FlatPrinter.html">RubyProf::FlatPrinter</a>
|
145
|
-
|
146
|
-
<li><a href="../RubyProf/FlatPrinterWithLineNumbers.html">RubyProf::FlatPrinterWithLineNumbers</a>
|
147
|
-
|
148
|
-
<li><a href="../RubyProf/GraphHtmlPrinter.html">RubyProf::GraphHtmlPrinter</a>
|
149
|
-
|
150
|
-
<li><a href="../RubyProf/GraphPrinter.html">RubyProf::GraphPrinter</a>
|
151
|
-
|
152
|
-
<li><a href="../RubyProf/MethodInfo.html">RubyProf::MethodInfo</a>
|
153
|
-
|
154
|
-
<li><a href="../RubyProf/MultiPrinter.html">RubyProf::MultiPrinter</a>
|
155
|
-
|
156
|
-
<li><a href="../RubyProf/Profile.html">RubyProf::Profile</a>
|
157
|
-
|
158
|
-
<li><a href="../RubyProf/ProfileTask.html">RubyProf::ProfileTask</a>
|
159
|
-
|
160
|
-
<li><a href="../RubyProf/Test.html">RubyProf::Test</a>
|
161
|
-
|
162
|
-
<li><a href="../RubyProf/Thread.html">RubyProf::Thread</a>
|
163
|
-
|
164
|
-
<li><a href="../Rack.html">Rack</a>
|
165
|
-
|
166
|
-
<li><a href="../Rack/RubyProf.html">Rack::RubyProf</a>
|
167
|
-
|
168
|
-
</ul>
|
169
|
-
</nav>
|
170
|
-
|
171
|
-
</div>
|
172
|
-
</nav>
|
173
|
-
|
174
|
-
<div id="documentation">
|
175
|
-
<h1 class="class">class RubyProf::GraphHtmlPrinter</h1>
|
176
|
-
|
177
|
-
<div id="description" class="description">
|
110
|
+
<section class="description">
|
178
111
|
|
179
112
|
<p>Generates <a href="../files/examples/graph_html.html">graph</a> profile
|
180
113
|
reports as html. To use the graph html printer:</p>
|
@@ -195,7 +128,7 @@ reports as html. To use the graph html printer:</p>
|
|
195
128
|
:template - specify an ERB template to use, instead of the
|
196
129
|
built-in self.template</pre>
|
197
130
|
|
198
|
-
</
|
131
|
+
</section>
|
199
132
|
|
200
133
|
|
201
134
|
|
@@ -206,24 +139,25 @@ reports as html. To use the graph html printer:</p>
|
|
206
139
|
|
207
140
|
|
208
141
|
|
209
|
-
|
210
|
-
|
211
|
-
|
142
|
+
<section class="constants-list">
|
143
|
+
<header>
|
144
|
+
<h3>Constants</h3>
|
145
|
+
</header>
|
212
146
|
<dl>
|
213
147
|
|
214
148
|
<dt id="CALL_WIDTH">CALL_WIDTH
|
215
149
|
|
216
|
-
<dd
|
150
|
+
<dd>
|
217
151
|
|
218
152
|
|
219
153
|
<dt id="PERCENTAGE_WIDTH">PERCENTAGE_WIDTH
|
220
154
|
|
221
|
-
<dd
|
155
|
+
<dd>
|
222
156
|
|
223
157
|
|
224
158
|
<dt id="TIME_WIDTH">TIME_WIDTH
|
225
159
|
|
226
|
-
<dd
|
160
|
+
<dd>
|
227
161
|
|
228
162
|
|
229
163
|
</dl>
|
@@ -232,10 +166,11 @@ reports as html. To use the graph html printer:</p>
|
|
232
166
|
|
233
167
|
|
234
168
|
|
235
|
-
<!-- Methods -->
|
236
169
|
|
237
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section
|
238
|
-
|
170
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
171
|
+
<header>
|
172
|
+
<h3>Public Instance Methods</h3>
|
173
|
+
</header>
|
239
174
|
|
240
175
|
|
241
176
|
<div id="method-i-create_link" class="method-detail ">
|
@@ -243,7 +178,9 @@ reports as html. To use the graph html printer:</p>
|
|
243
178
|
<div class="method-heading">
|
244
179
|
<span class="method-name">create_link</span><span
|
245
180
|
class="method-args">(thread, overall_time, method)</span>
|
181
|
+
|
246
182
|
<span class="method-click-advice">click to toggle source</span>
|
183
|
+
|
247
184
|
</div>
|
248
185
|
|
249
186
|
|
@@ -253,12 +190,13 @@ reports as html. To use the graph html printer:</p>
|
|
253
190
|
which are under the min_perecent specified by the user, since they will not
|
254
191
|
be printed out.</p>
|
255
192
|
|
193
|
+
|
256
194
|
|
257
195
|
|
258
196
|
<div class="method-source-code" id="create_link-source">
|
259
197
|
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 49</span>
|
260
198
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">create_link</span>(<span class="ruby-identifier">thread</span>, <span class="ruby-identifier">overall_time</span>, <span class="ruby-identifier">method</span>)
|
261
|
-
<span class="ruby-identifier">total_percent</span> = (<span class="ruby-identifier">method</span>.<span class="ruby-identifier">total_time</span><span class="ruby-operator">/</span><span class="ruby-identifier">overall_time</span>)
|
199
|
+
<span class="ruby-identifier">total_percent</span> = (<span class="ruby-identifier">method</span>.<span class="ruby-identifier">total_time</span><span class="ruby-operator">/</span><span class="ruby-identifier">overall_time</span>) <span class="ruby-operator">*</span> <span class="ruby-value">100</span>
|
262
200
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">total_percent</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">min_percent</span>
|
263
201
|
<span class="ruby-comment"># Just return name</span>
|
264
202
|
<span class="ruby-identifier">h</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">full_name</span>
|
@@ -267,14 +205,14 @@ be printed out.</p>
|
|
267
205
|
<span class="ruby-node">"<a href=\"#{href}\">#{h method.full_name}</a>"</span>
|
268
206
|
<span class="ruby-keyword">end</span>
|
269
207
|
<span class="ruby-keyword">end</span></pre>
|
270
|
-
</div
|
208
|
+
</div>
|
271
209
|
|
272
210
|
</div>
|
273
211
|
|
274
212
|
|
275
213
|
|
276
214
|
|
277
|
-
</div
|
215
|
+
</div>
|
278
216
|
|
279
217
|
|
280
218
|
<div id="method-i-file_link" class="method-detail ">
|
@@ -282,7 +220,9 @@ be printed out.</p>
|
|
282
220
|
<div class="method-heading">
|
283
221
|
<span class="method-name">file_link</span><span
|
284
222
|
class="method-args">(path, linenum)</span>
|
223
|
+
|
285
224
|
<span class="method-click-advice">click to toggle source</span>
|
225
|
+
|
286
226
|
</div>
|
287
227
|
|
288
228
|
|
@@ -290,30 +230,31 @@ be printed out.</p>
|
|
290
230
|
|
291
231
|
|
292
232
|
|
233
|
+
|
293
234
|
|
294
235
|
|
295
236
|
<div class="method-source-code" id="file_link-source">
|
296
237
|
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 64</span>
|
297
238
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">file_link</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">linenum</span>)
|
298
239
|
<span class="ruby-identifier">srcfile</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">path</span>)
|
299
|
-
<span class="ruby-keyword">if</span> <span class="ruby-identifier">srcfile</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp"
|
240
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">srcfile</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/\/ruby_runtime$/</span>
|
300
241
|
<span class="ruby-string">""</span>
|
301
242
|
<span class="ruby-keyword">else</span>
|
302
|
-
<span class="ruby-keyword">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp"
|
243
|
+
<span class="ruby-keyword">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/darwin/</span>
|
303
244
|
<span class="ruby-node">"<a href=\"txmt://open?url=file://#{h srcfile}&line=#{linenum}\" title=\"#{h srcfile}:#{linenum}\">#{linenum}</a>"</span>
|
304
245
|
<span class="ruby-keyword">else</span>
|
305
246
|
<span class="ruby-node">"<a href=\"file://#{h srcfile}##{linenum}\" title=\"#{h srcfile}:#{linenum}\">#{linenum}</a>"</span>
|
306
247
|
<span class="ruby-keyword">end</span>
|
307
248
|
<span class="ruby-keyword">end</span>
|
308
249
|
<span class="ruby-keyword">end</span></pre>
|
309
|
-
</div
|
250
|
+
</div>
|
310
251
|
|
311
252
|
</div>
|
312
253
|
|
313
254
|
|
314
255
|
|
315
256
|
|
316
|
-
</div
|
257
|
+
</div>
|
317
258
|
|
318
259
|
|
319
260
|
<div id="method-i-method_href" class="method-detail ">
|
@@ -321,7 +262,9 @@ be printed out.</p>
|
|
321
262
|
<div class="method-heading">
|
322
263
|
<span class="method-name">method_href</span><span
|
323
264
|
class="method-args">(thread, method)</span>
|
265
|
+
|
324
266
|
<span class="method-click-advice">click to toggle source</span>
|
267
|
+
|
325
268
|
</div>
|
326
269
|
|
327
270
|
|
@@ -329,21 +272,22 @@ be printed out.</p>
|
|
329
272
|
|
330
273
|
|
331
274
|
|
275
|
+
|
332
276
|
|
333
277
|
|
334
278
|
<div class="method-source-code" id="method_href-source">
|
335
279
|
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 60</span>
|
336
280
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">method_href</span>(<span class="ruby-identifier">thread</span>, <span class="ruby-identifier">method</span>)
|
337
|
-
<span class="ruby-identifier">h</span>(<span class="ruby-identifier">method</span>.<span class="ruby-identifier">full_name</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node"
|
281
|
+
<span class="ruby-identifier">h</span>(<span class="ruby-identifier">method</span>.<span class="ruby-identifier">full_name</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/[><#\.\?=:]/</span>,<span class="ruby-string">"_"</span>) <span class="ruby-operator">+</span> <span class="ruby-string">"_"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">fiber_id</span>.<span class="ruby-identifier">to_s</span>)
|
338
282
|
<span class="ruby-keyword">end</span></pre>
|
339
|
-
</div
|
283
|
+
</div>
|
340
284
|
|
341
285
|
</div>
|
342
286
|
|
343
287
|
|
344
288
|
|
345
289
|
|
346
|
-
</div
|
290
|
+
</div>
|
347
291
|
|
348
292
|
|
349
293
|
<div id="method-i-print" class="method-detail ">
|
@@ -351,7 +295,9 @@ be printed out.</p>
|
|
351
295
|
<div class="method-heading">
|
352
296
|
<span class="method-name">print</span><span
|
353
297
|
class="method-args">(output = STDOUT, options = {})</span>
|
298
|
+
|
354
299
|
<span class="method-click-advice">click to toggle source</span>
|
300
|
+
|
355
301
|
</div>
|
356
302
|
|
357
303
|
|
@@ -359,6 +305,7 @@ be printed out.</p>
|
|
359
305
|
|
360
306
|
|
361
307
|
|
308
|
+
|
362
309
|
|
363
310
|
|
364
311
|
<div class="method-source-code" id="print-source">
|
@@ -368,14 +315,14 @@ be printed out.</p>
|
|
368
315
|
<span class="ruby-identifier">setup_options</span>(<span class="ruby-identifier">options</span>)
|
369
316
|
<span class="ruby-ivar">@output</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@erb</span>.<span class="ruby-identifier">result</span>(<span class="ruby-identifier">binding</span>)
|
370
317
|
<span class="ruby-keyword">end</span></pre>
|
371
|
-
</div
|
318
|
+
</div>
|
372
319
|
|
373
320
|
</div>
|
374
321
|
|
375
322
|
|
376
323
|
|
377
324
|
|
378
|
-
</div
|
325
|
+
</div>
|
379
326
|
|
380
327
|
|
381
328
|
<div id="method-i-setup_options" class="method-detail ">
|
@@ -383,7 +330,9 @@ be printed out.</p>
|
|
383
330
|
<div class="method-heading">
|
384
331
|
<span class="method-name">setup_options</span><span
|
385
332
|
class="method-args">(options)</span>
|
333
|
+
|
386
334
|
<span class="method-click-advice">click to toggle source</span>
|
335
|
+
|
387
336
|
</div>
|
388
337
|
|
389
338
|
|
@@ -391,6 +340,12 @@ be printed out.</p>
|
|
391
340
|
|
392
341
|
|
393
342
|
|
343
|
+
|
344
|
+
<div class="method-calls-super">
|
345
|
+
Calls superclass method
|
346
|
+
<a href="AbstractPrinter.html#method-i-setup_options">RubyProf::AbstractPrinter#setup_options</a>
|
347
|
+
</div>
|
348
|
+
|
394
349
|
|
395
350
|
|
396
351
|
<div class="method-source-code" id="setup_options-source">
|
@@ -403,14 +358,14 @@ be printed out.</p>
|
|
403
358
|
<span class="ruby-ivar">@erb</span> = <span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">template</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>)
|
404
359
|
<span class="ruby-ivar">@erb</span>.<span class="ruby-identifier">filename</span> = <span class="ruby-identifier">filename</span>
|
405
360
|
<span class="ruby-keyword">end</span></pre>
|
406
|
-
</div
|
361
|
+
</div>
|
407
362
|
|
408
363
|
</div>
|
409
364
|
|
410
365
|
|
411
366
|
|
412
367
|
|
413
|
-
</div
|
368
|
+
</div>
|
414
369
|
|
415
370
|
|
416
371
|
<div id="method-i-template" class="method-detail ">
|
@@ -418,7 +373,9 @@ be printed out.</p>
|
|
418
373
|
<div class="method-heading">
|
419
374
|
<span class="method-name">template</span><span
|
420
375
|
class="method-args">()</span>
|
376
|
+
|
421
377
|
<span class="method-click-advice">click to toggle source</span>
|
378
|
+
|
422
379
|
</div>
|
423
380
|
|
424
381
|
|
@@ -426,6 +383,7 @@ be printed out.</p>
|
|
426
383
|
|
427
384
|
|
428
385
|
|
386
|
+
|
429
387
|
|
430
388
|
|
431
389
|
<div class="method-source-code" id="template-source">
|
@@ -493,16 +451,12 @@ be printed out.</p>
|
|
493
451
|
<table>
|
494
452
|
<tr>
|
495
453
|
<th>Thread ID</th>
|
496
|
-
<% if RUBY_VERSION >= "1.9" %>
|
497
454
|
<th>Fiber ID</th>
|
498
|
-
<% end %>
|
499
455
|
<th>Total Time</th>
|
500
456
|
</tr>
|
501
457
|
<% for thread in @result.threads %>
|
502
458
|
<tr>
|
503
|
-
<% if RUBY_VERSION >= "1.9" %>
|
504
459
|
<td><%= thread.id %></td>
|
505
|
-
<% end %>
|
506
460
|
<td><a href="#<%= thread.fiber_id %>"><%= thread.fiber_id %></a></td>
|
507
461
|
<td><%= thread.total_time %></td>
|
508
462
|
</tr>
|
@@ -513,11 +467,7 @@ be printed out.</p>
|
|
513
467
|
<% for thread in @result.threads
|
514
468
|
methods = thread.methods
|
515
469
|
total_time = thread.total_time %>
|
516
|
-
<% if RUBY_VERSION >= "1.9" %>
|
517
470
|
<h2><a name="<%= thread.fiber_id %>">Thread <%= thread.id %>, Fiber: <%= thread.fiber_id %></a></h2>
|
518
|
-
<% else %>
|
519
|
-
<h2><a name="<%= thread.fiber_id %>">Thread <%= thread.fiber_id %></a></h2>
|
520
|
-
<% end %>
|
521
471
|
<table>
|
522
472
|
<thead>
|
523
473
|
<tr>
|
@@ -605,26 +555,25 @@ be printed out.</p>
|
|
605
555
|
</body>
|
606
556
|
</html>'</span>
|
607
557
|
<span class="ruby-keyword">end</span></pre>
|
608
|
-
</div
|
558
|
+
</div>
|
609
559
|
|
610
560
|
</div>
|
611
561
|
|
612
562
|
|
613
563
|
|
614
564
|
|
615
|
-
</div
|
565
|
+
</div>
|
616
566
|
|
617
567
|
|
618
|
-
</section
|
568
|
+
</section>
|
619
569
|
|
620
|
-
</section
|
621
|
-
|
622
|
-
</div><!-- documentation -->
|
570
|
+
</section>
|
571
|
+
</main>
|
623
572
|
|
624
573
|
|
625
|
-
<footer id="validator-badges">
|
626
|
-
<p><a href="http://validator.w3.org/check/referer">
|
627
|
-
<p>Generated by <a href="
|
628
|
-
<p>
|
574
|
+
<footer id="validator-badges" role="contentinfo">
|
575
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
576
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
577
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
629
578
|
</footer>
|
630
579
|
|