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.
Files changed (209) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGES +579 -371
  3. data/LICENSE +24 -23
  4. data/README.rdoc +5 -433
  5. data/Rakefile +98 -110
  6. data/bin/ruby-prof +328 -329
  7. data/bin/ruby-prof-check-trace +45 -0
  8. data/ext/ruby_prof/extconf.rb +16 -59
  9. data/ext/ruby_prof/rp_aggregate_call_tree.c +59 -0
  10. data/ext/ruby_prof/rp_aggregate_call_tree.h +13 -0
  11. data/ext/ruby_prof/rp_allocation.c +287 -0
  12. data/ext/ruby_prof/rp_allocation.h +31 -0
  13. data/ext/ruby_prof/rp_call_tree.c +369 -0
  14. data/ext/ruby_prof/rp_call_tree.h +43 -0
  15. data/ext/ruby_prof/rp_call_trees.c +288 -0
  16. data/ext/ruby_prof/rp_call_trees.h +28 -0
  17. data/ext/ruby_prof/rp_measure_allocations.c +50 -65
  18. data/ext/ruby_prof/rp_measure_memory.c +42 -73
  19. data/ext/ruby_prof/rp_measure_process_time.c +65 -71
  20. data/ext/ruby_prof/rp_measure_wall_time.c +64 -42
  21. data/ext/ruby_prof/rp_measurement.c +237 -0
  22. data/ext/ruby_prof/rp_measurement.h +50 -0
  23. data/ext/ruby_prof/rp_method.c +491 -420
  24. data/ext/ruby_prof/rp_method.h +62 -57
  25. data/ext/ruby_prof/rp_profile.c +908 -0
  26. data/ext/ruby_prof/rp_profile.h +35 -0
  27. data/ext/ruby_prof/rp_stack.c +212 -128
  28. data/ext/ruby_prof/rp_stack.h +53 -51
  29. data/ext/ruby_prof/rp_thread.c +362 -268
  30. data/ext/ruby_prof/rp_thread.h +39 -27
  31. data/ext/ruby_prof/ruby_prof.c +52 -695
  32. data/ext/ruby_prof/ruby_prof.h +26 -55
  33. data/ext/ruby_prof/vc/ruby_prof.sln +28 -21
  34. data/ext/ruby_prof/vc/{ruby_prof_20.vcxproj → ruby_prof.vcxproj} +56 -8
  35. data/lib/ruby-prof.rb +52 -67
  36. data/lib/ruby-prof/assets/call_stack_printer.html.erb +710 -0
  37. data/lib/ruby-prof/assets/call_stack_printer.png +0 -0
  38. data/lib/ruby-prof/assets/graph_printer.html.erb +355 -0
  39. data/lib/ruby-prof/call_tree.rb +57 -0
  40. data/lib/ruby-prof/call_tree_visitor.rb +36 -0
  41. data/lib/ruby-prof/compatibility.rb +99 -169
  42. data/lib/ruby-prof/exclude_common_methods.rb +198 -0
  43. data/lib/ruby-prof/measurement.rb +17 -0
  44. data/lib/ruby-prof/method_info.rb +78 -131
  45. data/lib/ruby-prof/printers/abstract_printer.rb +137 -85
  46. data/lib/ruby-prof/printers/call_info_printer.rb +53 -41
  47. data/lib/ruby-prof/printers/call_stack_printer.rb +180 -773
  48. data/lib/ruby-prof/printers/call_tree_printer.rb +151 -92
  49. data/lib/ruby-prof/printers/dot_printer.rb +132 -132
  50. data/lib/ruby-prof/printers/flat_printer.rb +53 -69
  51. data/lib/ruby-prof/printers/graph_html_printer.rb +63 -255
  52. data/lib/ruby-prof/printers/graph_printer.rb +113 -116
  53. data/lib/ruby-prof/printers/multi_printer.rb +127 -56
  54. data/lib/ruby-prof/profile.rb +37 -77
  55. data/lib/ruby-prof/rack.rb +62 -15
  56. data/lib/ruby-prof/task.rb +147 -147
  57. data/lib/ruby-prof/thread.rb +10 -12
  58. data/lib/ruby-prof/version.rb +3 -0
  59. data/lib/unprof.rb +10 -10
  60. data/ruby-prof.gemspec +65 -61
  61. data/test/abstract_printer_test.rb +26 -0
  62. data/test/alias_test.rb +126 -0
  63. data/test/basic_test.rb +43 -128
  64. data/test/call_tree_visitor_test.rb +32 -0
  65. data/test/call_trees_test.rb +66 -0
  66. data/test/duplicate_names_test.rb +32 -32
  67. data/test/dynamic_method_test.rb +53 -74
  68. data/test/enumerable_test.rb +21 -16
  69. data/test/exceptions_test.rb +24 -16
  70. data/test/exclude_methods_test.rb +151 -0
  71. data/test/exclude_threads_test.rb +53 -54
  72. data/test/fiber_test.rb +129 -65
  73. data/test/gc_test.rb +90 -0
  74. data/test/inverse_call_tree_test.rb +175 -0
  75. data/test/line_number_test.rb +158 -71
  76. data/test/marshal_test.rb +113 -0
  77. data/test/measure_allocations.rb +30 -0
  78. data/test/measure_allocations_test.rb +375 -25
  79. data/test/measure_allocations_trace_test.rb +375 -0
  80. data/test/measure_memory_trace_test.rb +1101 -0
  81. data/test/measure_process_time_test.rb +785 -62
  82. data/test/measure_times.rb +56 -0
  83. data/test/measure_wall_time_test.rb +434 -254
  84. data/test/multi_printer_test.rb +71 -82
  85. data/test/no_method_class_test.rb +15 -15
  86. data/test/pause_resume_test.rb +175 -166
  87. data/test/prime.rb +54 -54
  88. data/test/prime_script.rb +6 -0
  89. data/test/printer_call_stack_test.rb +27 -0
  90. data/test/printer_call_tree_test.rb +30 -0
  91. data/test/printer_flat_test.rb +99 -0
  92. data/test/printer_graph_html_test.rb +59 -0
  93. data/test/printer_graph_test.rb +40 -0
  94. data/test/printers_test.rb +141 -257
  95. data/test/printing_recursive_graph_test.rb +81 -0
  96. data/test/profile_test.rb +16 -0
  97. data/test/rack_test.rb +93 -0
  98. data/test/recursive_test.rb +206 -215
  99. data/test/singleton_test.rb +38 -38
  100. data/test/stack_printer_test.rb +64 -78
  101. data/test/start_stop_test.rb +109 -112
  102. data/test/test_helper.rb +13 -115
  103. data/test/thread_test.rb +144 -178
  104. data/test/unique_call_path_test.rb +120 -224
  105. data/test/yarv_test.rb +56 -0
  106. metadata +77 -133
  107. data/doc/LICENSE.html +0 -155
  108. data/doc/README_rdoc.html +0 -648
  109. data/doc/Rack.html +0 -167
  110. data/doc/Rack/RubyProf.html +0 -319
  111. data/doc/RubyProf.html +0 -1000
  112. data/doc/RubyProf/AbstractPrinter.html +0 -580
  113. data/doc/RubyProf/AggregateCallInfo.html +0 -570
  114. data/doc/RubyProf/CallInfo.html +0 -512
  115. data/doc/RubyProf/CallInfoPrinter.html +0 -190
  116. data/doc/RubyProf/CallInfoVisitor.html +0 -332
  117. data/doc/RubyProf/CallStackPrinter.html +0 -1600
  118. data/doc/RubyProf/CallTreePrinter.html +0 -413
  119. data/doc/RubyProf/Cmd.html +0 -669
  120. data/doc/RubyProf/DotPrinter.html +0 -312
  121. data/doc/RubyProf/FlatPrinter.html +0 -229
  122. data/doc/RubyProf/FlatPrinterWithLineNumbers.html +0 -267
  123. data/doc/RubyProf/GraphHtmlPrinter.html +0 -630
  124. data/doc/RubyProf/GraphPrinter.html +0 -209
  125. data/doc/RubyProf/MethodInfo.html +0 -713
  126. data/doc/RubyProf/MultiPrinter.html +0 -407
  127. data/doc/RubyProf/Profile.html +0 -821
  128. data/doc/RubyProf/ProfileTask.html +0 -532
  129. data/doc/RubyProf/Test.html +0 -578
  130. data/doc/RubyProf/Thread.html +0 -262
  131. data/doc/created.rid +0 -32
  132. data/doc/examples/flat_txt.html +0 -191
  133. data/doc/examples/graph_txt.html +0 -305
  134. data/doc/images/add.png +0 -0
  135. data/doc/images/brick.png +0 -0
  136. data/doc/images/brick_link.png +0 -0
  137. data/doc/images/bug.png +0 -0
  138. data/doc/images/bullet_black.png +0 -0
  139. data/doc/images/bullet_toggle_minus.png +0 -0
  140. data/doc/images/bullet_toggle_plus.png +0 -0
  141. data/doc/images/date.png +0 -0
  142. data/doc/images/delete.png +0 -0
  143. data/doc/images/find.png +0 -0
  144. data/doc/images/loadingAnimation.gif +0 -0
  145. data/doc/images/macFFBgHack.png +0 -0
  146. data/doc/images/package.png +0 -0
  147. data/doc/images/page_green.png +0 -0
  148. data/doc/images/page_white_text.png +0 -0
  149. data/doc/images/page_white_width.png +0 -0
  150. data/doc/images/plugin.png +0 -0
  151. data/doc/images/ruby.png +0 -0
  152. data/doc/images/tag_blue.png +0 -0
  153. data/doc/images/tag_green.png +0 -0
  154. data/doc/images/transparent.png +0 -0
  155. data/doc/images/wrench.png +0 -0
  156. data/doc/images/wrench_orange.png +0 -0
  157. data/doc/images/zoom.png +0 -0
  158. data/doc/index.html +0 -647
  159. data/doc/js/darkfish.js +0 -155
  160. data/doc/js/jquery.js +0 -18
  161. data/doc/js/navigation.js +0 -142
  162. data/doc/js/search.js +0 -94
  163. data/doc/js/search_index.js +0 -1
  164. data/doc/js/searcher.js +0 -228
  165. data/doc/rdoc.css +0 -543
  166. data/doc/table_of_contents.html +0 -462
  167. data/examples/empty.png +0 -0
  168. data/examples/flat.txt +0 -55
  169. data/examples/graph.dot +0 -106
  170. data/examples/graph.html +0 -823
  171. data/examples/graph.png +0 -0
  172. data/examples/graph.txt +0 -170
  173. data/examples/minus.png +0 -0
  174. data/examples/multi.flat.txt +0 -23
  175. data/examples/multi.graph.html +0 -906
  176. data/examples/multi.grind.dat +0 -194
  177. data/examples/multi.stack.html +0 -573
  178. data/examples/plus.png +0 -0
  179. data/examples/stack.html +0 -573
  180. data/ext/ruby_prof/rp_call_info.c +0 -407
  181. data/ext/ruby_prof/rp_call_info.h +0 -48
  182. data/ext/ruby_prof/rp_measure.c +0 -48
  183. data/ext/ruby_prof/rp_measure.h +0 -45
  184. data/ext/ruby_prof/rp_measure_cpu_time.c +0 -112
  185. data/ext/ruby_prof/rp_measure_gc_runs.c +0 -65
  186. data/ext/ruby_prof/rp_measure_gc_time.c +0 -57
  187. data/ext/ruby_prof/vc/ruby_prof_18.vcxproj +0 -108
  188. data/ext/ruby_prof/vc/ruby_prof_19.vcxproj +0 -110
  189. data/ext/ruby_prof/version.h +0 -7
  190. data/lib/ruby-prof/aggregate_call_info.rb +0 -72
  191. data/lib/ruby-prof/call_info.rb +0 -89
  192. data/lib/ruby-prof/call_info_visitor.rb +0 -44
  193. data/lib/ruby-prof/images/empty.png +0 -0
  194. data/lib/ruby-prof/images/minus.png +0 -0
  195. data/lib/ruby-prof/images/plus.png +0 -0
  196. data/lib/ruby-prof/printers/flat_printer_with_line_numbers.rb +0 -57
  197. data/lib/ruby-prof/test.rb +0 -150
  198. data/test/aggregate_test.rb +0 -136
  199. data/test/call_info_test.rb +0 -78
  200. data/test/call_info_visitor_test.rb +0 -31
  201. data/test/exec_test.rb +0 -14
  202. data/test/measure_cpu_time_test.rb +0 -220
  203. data/test/measure_gc_runs_test.rb +0 -32
  204. data/test/measure_gc_time_test.rb +0 -36
  205. data/test/measure_memory_test.rb +0 -31
  206. data/test/method_elimination_test.rb +0 -84
  207. data/test/module_test.rb +0 -45
  208. data/test/stack_test.rb +0 -138
  209. data/test/test_suite.rb +0 -37
@@ -1,267 +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>class RubyProf::FlatPrinterWithLineNumbers - 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="class">
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>lib/ruby-prof/printers/flat_printer_with_line_numbers.rb
51
- </ul>
52
- </nav>
53
-
54
-
55
- </div>
56
-
57
- <div id="class-metadata">
58
-
59
- <nav id="parent-class-section" class="section">
60
- <h3 class="section-header">Parent</h3>
61
-
62
- <p class="link"><a href="FlatPrinter.html">RubyProf::FlatPrinter</a>
63
-
64
- </nav>
65
-
66
-
67
- <!-- Method Quickref -->
68
- <nav id="method-list-section" class="section">
69
- <h3 class="section-header">Methods</h3>
70
-
71
- <ul class="link-list">
72
-
73
- <li><a href="#method-i-print_methods">#print_methods</a>
74
-
75
- </ul>
76
- </nav>
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>
148
-
149
- </div>
150
- </nav>
151
-
152
- <div id="documentation">
153
- <h1 class="class">class RubyProf::FlatPrinterWithLineNumbers</h1>
154
-
155
- <div id="description" class="description">
156
-
157
- <p>Generates <a href="../files/examples/flat_txt.html">flat</a> profile
158
- reports as text. To use the flat printer with line numbers:</p>
159
-
160
- <pre>result = RubyProf.profile do
161
- [code to profile]
162
- end
163
-
164
- printer = RubyProf::FlatPrinterWithLineNumbers.new(result)
165
- printer.print(STDOUT, {})</pre>
166
-
167
- </div><!-- description -->
168
-
169
-
170
-
171
-
172
- <section id="5Buntitled-5D" class="documentation-section">
173
-
174
-
175
-
176
-
177
-
178
-
179
-
180
-
181
- <!-- Methods -->
182
-
183
- <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
184
- <h3 class="section-header">Public Instance Methods</h3>
185
-
186
-
187
- <div id="method-i-print_methods" class="method-detail ">
188
-
189
- <div class="method-heading">
190
- <span class="method-name">print_methods</span><span
191
- class="method-args">(thread)</span>
192
- <span class="method-click-advice">click to toggle source</span>
193
- </div>
194
-
195
-
196
- <div class="method-description">
197
-
198
-
199
-
200
-
201
-
202
- <div class="method-source-code" id="print_methods-source">
203
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/flat_printer_with_line_numbers.rb, line 14</span>
204
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">print_methods</span>(<span class="ruby-identifier">thread</span>)
205
- <span class="ruby-identifier">total_time</span> = <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">total_time</span>
206
-
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>(&amp;<span class="ruby-identifier">sort_method</span>).<span class="ruby-identifier">reverse</span>
208
- <span class="ruby-identifier">sum</span> = <span class="ruby-value">0</span>
209
- <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>) * <span class="ruby-value">100</span>
211
- <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">self_percent</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">min_percent</span>
212
-
213
- <span class="ruby-identifier">sum</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">self_time</span>
214
- <span class="ruby-comment">#self_time_called = method.called &gt; 0 ? method.self_time/method.called : 0</span>
215
- <span class="ruby-comment">#total_time_called = method.called &gt; 0? method.total_time/method.called : 0</span>
216
-
217
- <span class="ruby-ivar">@output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;%6.2f %9.3f %9.3f %9.3f %9.3f %8d %s%s \n&quot;</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> * <span class="ruby-value">100</span>, <span class="ruby-comment"># %self</span>
219
- <span class="ruby-identifier">method</span>.<span class="ruby-identifier">total_time</span>, <span class="ruby-comment"># total</span>
220
- <span class="ruby-identifier">method</span>.<span class="ruby-identifier">self_time</span>, <span class="ruby-comment"># self</span>
221
- <span class="ruby-identifier">method</span>.<span class="ruby-identifier">wait_time</span>, <span class="ruby-comment"># wait</span>
222
- <span class="ruby-identifier">method</span>.<span class="ruby-identifier">children_time</span>, <span class="ruby-comment"># children</span>
223
- <span class="ruby-identifier">method</span>.<span class="ruby-identifier">called</span>, <span class="ruby-comment"># calls</span>
224
- <span class="ruby-identifier">method</span>.<span class="ruby-identifier">recursive?</span> <span class="ruby-operator">?</span> <span class="ruby-string">&quot;*&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-string">&quot; &quot;</span>, <span class="ruby-comment"># cycle</span>
225
- <span class="ruby-identifier">method_name</span>(<span class="ruby-identifier">method</span>) <span class="ruby-comment"># name</span>
226
- ]
227
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">source_file</span> <span class="ruby-operator">!=</span> <span class="ruby-string">&#39;ruby_runtime&#39;</span>
228
- <span class="ruby-ivar">@output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot; %s:%s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">method</span>.<span class="ruby-identifier">source_file</span>), <span class="ruby-identifier">method</span>.<span class="ruby-identifier">line</span>]
229
- <span class="ruby-keyword">end</span>
230
- <span class="ruby-ivar">@output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n\tcalled from: &quot;</span>
231
-
232
- <span class="ruby-comment"># make sure they&#39;re unique</span>
233
- <span class="ruby-identifier">method</span>.<span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">ci</span><span class="ruby-operator">|</span>
234
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">ci</span>.<span class="ruby-identifier">parent</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">ci</span>.<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">target</span>.<span class="ruby-identifier">source_file</span> <span class="ruby-operator">!=</span> <span class="ruby-string">&#39;ruby_runtime&#39;</span>
235
- [<span class="ruby-identifier">method_name</span>(<span class="ruby-identifier">ci</span>.<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">target</span>), <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">ci</span>.<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">target</span>.<span class="ruby-identifier">source_file</span>), <span class="ruby-identifier">ci</span>.<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">target</span>.<span class="ruby-identifier">line</span>]
236
- <span class="ruby-keyword">else</span>
237
- <span class="ruby-keyword">nil</span>
238
- <span class="ruby-keyword">end</span>
239
- }.<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">uniq</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">args</span><span class="ruby-operator">|</span>
240
- <span class="ruby-ivar">@output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot; %s (%s:%s) &quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">args</span>
241
- }
242
- <span class="ruby-ivar">@output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n\n&quot;</span>
243
- <span class="ruby-keyword">end</span>
244
- <span class="ruby-keyword">end</span></pre>
245
- </div><!-- print_methods-source -->
246
-
247
- </div>
248
-
249
-
250
-
251
-
252
- </div><!-- print_methods-method -->
253
-
254
-
255
- </section><!-- public-instance-method-details -->
256
-
257
- </section><!-- 5Buntitled-5D -->
258
-
259
- </div><!-- documentation -->
260
-
261
-
262
- <footer id="validator-badges">
263
- <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
264
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
265
- <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
266
- </footer>
267
-
@@ -1,630 +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>class RubyProf::GraphHtmlPrinter - 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="class">
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>lib/ruby-prof/printers/graph_html_printer.rb
51
- </ul>
52
- </nav>
53
-
54
-
55
- </div>
56
-
57
- <div id="class-metadata">
58
-
59
- <nav id="parent-class-section" class="section">
60
- <h3 class="section-header">Parent</h3>
61
-
62
- <p class="link"><a href="AbstractPrinter.html">RubyProf::AbstractPrinter</a>
63
-
64
- </nav>
65
-
66
- <!-- Included Modules -->
67
- <nav id="includes-section" class="section">
68
- <h3 class="section-header">Included Modules</h3>
69
-
70
- <ul class="link-list">
71
-
72
-
73
- <li><span class="include">ERB::Util</span>
74
-
75
-
76
- </ul>
77
- </nav>
78
-
79
- <!-- Method Quickref -->
80
- <nav id="method-list-section" class="section">
81
- <h3 class="section-header">Methods</h3>
82
-
83
- <ul class="link-list">
84
-
85
- <li><a href="#method-i-create_link">#create_link</a>
86
-
87
- <li><a href="#method-i-file_link">#file_link</a>
88
-
89
- <li><a href="#method-i-method_href">#method_href</a>
90
-
91
- <li><a href="#method-i-print">#print</a>
92
-
93
- <li><a href="#method-i-setup_options">#setup_options</a>
94
-
95
- <li><a href="#method-i-template">#template</a>
96
-
97
- </ul>
98
- </nav>
99
-
100
- </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
- </nav>
118
-
119
- <nav id="classindex-section" class="section project-section">
120
- <h3 class="section-header">Class and Module Index</h3>
121
-
122
- <ul class="link-list">
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">
178
-
179
- <p>Generates <a href="../files/examples/graph_html.html">graph</a> profile
180
- reports as html. To use the graph html printer:</p>
181
-
182
- <pre class="ruby"><span class="ruby-identifier">result</span> = <span class="ruby-constant">RubyProf</span>.<span class="ruby-identifier">profile</span> <span class="ruby-keyword">do</span>
183
- [<span class="ruby-identifier">code</span> <span class="ruby-identifier">to</span> <span class="ruby-identifier">profile</span>]
184
- <span class="ruby-keyword">end</span>
185
-
186
- <span class="ruby-identifier">printer</span> = <span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">GraphHtmlPrinter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">result</span>)
187
- <span class="ruby-identifier">printer</span>.<span class="ruby-identifier">print</span>(<span class="ruby-constant">STDOUT</span>, :<span class="ruby-identifier">min_percent=</span><span class="ruby-operator">&gt;</span><span class="ruby-value">0</span>)
188
- </pre>
189
-
190
- <p>The Graph printer takes the following options in its print methods:</p>
191
-
192
- <pre>:filename - specify a file to use that contains the ERB
193
- template to use, instead of the built-in self.template
194
-
195
- :template - specify an ERB template to use, instead of the
196
- built-in self.template</pre>
197
-
198
- </div><!-- description -->
199
-
200
-
201
-
202
-
203
- <section id="5Buntitled-5D" class="documentation-section">
204
-
205
-
206
-
207
-
208
-
209
- <!-- Constants -->
210
- <section id="constants-list" class="section">
211
- <h3 class="section-header">Constants</h3>
212
- <dl>
213
-
214
- <dt id="CALL_WIDTH">CALL_WIDTH
215
-
216
- <dd class="description">
217
-
218
-
219
- <dt id="PERCENTAGE_WIDTH">PERCENTAGE_WIDTH
220
-
221
- <dd class="description">
222
-
223
-
224
- <dt id="TIME_WIDTH">TIME_WIDTH
225
-
226
- <dd class="description">
227
-
228
-
229
- </dl>
230
- </section>
231
-
232
-
233
-
234
-
235
- <!-- Methods -->
236
-
237
- <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
238
- <h3 class="section-header">Public Instance Methods</h3>
239
-
240
-
241
- <div id="method-i-create_link" class="method-detail ">
242
-
243
- <div class="method-heading">
244
- <span class="method-name">create_link</span><span
245
- class="method-args">(thread, overall_time, method)</span>
246
- <span class="method-click-advice">click to toggle source</span>
247
- </div>
248
-
249
-
250
- <div class="method-description">
251
-
252
- <p>Creates a link to a method. Note that we do not create links to methods
253
- which are under the min_perecent specified by the user, since they will not
254
- be printed out.</p>
255
-
256
-
257
-
258
- <div class="method-source-code" id="create_link-source">
259
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 49</span>
260
- <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>) * <span class="ruby-value">100</span>
262
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">total_percent</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">min_percent</span>
263
- <span class="ruby-comment"># Just return name</span>
264
- <span class="ruby-identifier">h</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">full_name</span>
265
- <span class="ruby-keyword">else</span>
266
- <span class="ruby-identifier">href</span> = <span class="ruby-string">&#39;#&#39;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">method_href</span>(<span class="ruby-identifier">thread</span>, <span class="ruby-identifier">method</span>)
267
- <span class="ruby-node">&quot;&lt;a href=\&quot;#{href}\&quot;&gt;#{h method.full_name}&lt;/a&gt;&quot;</span>
268
- <span class="ruby-keyword">end</span>
269
- <span class="ruby-keyword">end</span></pre>
270
- </div><!-- create_link-source -->
271
-
272
- </div>
273
-
274
-
275
-
276
-
277
- </div><!-- create_link-method -->
278
-
279
-
280
- <div id="method-i-file_link" class="method-detail ">
281
-
282
- <div class="method-heading">
283
- <span class="method-name">file_link</span><span
284
- class="method-args">(path, linenum)</span>
285
- <span class="method-click-advice">click to toggle source</span>
286
- </div>
287
-
288
-
289
- <div class="method-description">
290
-
291
-
292
-
293
-
294
-
295
- <div class="method-source-code" id="file_link-source">
296
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 64</span>
297
- <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
- <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">%r\/ruby_runtime$/</span>
300
- <span class="ruby-string">&quot;&quot;</span>
301
- <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">%rdarwin/</span>
303
- <span class="ruby-node">&quot;&lt;a href=\&quot;txmt://open?url=file://#{h srcfile}&amp;line=#{linenum}\&quot; title=\&quot;#{h srcfile}:#{linenum}\&quot;&gt;#{linenum}&lt;/a&gt;&quot;</span>
304
- <span class="ruby-keyword">else</span>
305
- <span class="ruby-node">&quot;&lt;a href=\&quot;file://#{h srcfile}##{linenum}\&quot; title=\&quot;#{h srcfile}:#{linenum}\&quot;&gt;#{linenum}&lt;/a&gt;&quot;</span>
306
- <span class="ruby-keyword">end</span>
307
- <span class="ruby-keyword">end</span>
308
- <span class="ruby-keyword">end</span></pre>
309
- </div><!-- file_link-source -->
310
-
311
- </div>
312
-
313
-
314
-
315
-
316
- </div><!-- file_link-method -->
317
-
318
-
319
- <div id="method-i-method_href" class="method-detail ">
320
-
321
- <div class="method-heading">
322
- <span class="method-name">method_href</span><span
323
- class="method-args">(thread, method)</span>
324
- <span class="method-click-advice">click to toggle source</span>
325
- </div>
326
-
327
-
328
- <div class="method-description">
329
-
330
-
331
-
332
-
333
-
334
- <div class="method-source-code" id="method_href-source">
335
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 60</span>
336
- <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">%r[&gt;&lt;#\.\?=:]/</span>,<span class="ruby-string">&quot;_&quot;</span>) <span class="ruby-operator">+</span> <span class="ruby-string">&quot;_&quot;</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
- <span class="ruby-keyword">end</span></pre>
339
- </div><!-- method_href-source -->
340
-
341
- </div>
342
-
343
-
344
-
345
-
346
- </div><!-- method_href-method -->
347
-
348
-
349
- <div id="method-i-print" class="method-detail ">
350
-
351
- <div class="method-heading">
352
- <span class="method-name">print</span><span
353
- class="method-args">(output = STDOUT, options = {})</span>
354
- <span class="method-click-advice">click to toggle source</span>
355
- </div>
356
-
357
-
358
- <div class="method-description">
359
-
360
-
361
-
362
-
363
-
364
- <div class="method-source-code" id="print-source">
365
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 39</span>
366
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">print</span>(<span class="ruby-identifier">output</span> = <span class="ruby-constant">STDOUT</span>, <span class="ruby-identifier">options</span> = {})
367
- <span class="ruby-ivar">@output</span> = <span class="ruby-identifier">output</span>
368
- <span class="ruby-identifier">setup_options</span>(<span class="ruby-identifier">options</span>)
369
- <span class="ruby-ivar">@output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@erb</span>.<span class="ruby-identifier">result</span>(<span class="ruby-identifier">binding</span>)
370
- <span class="ruby-keyword">end</span></pre>
371
- </div><!-- print-source -->
372
-
373
- </div>
374
-
375
-
376
-
377
-
378
- </div><!-- print-method -->
379
-
380
-
381
- <div id="method-i-setup_options" class="method-detail ">
382
-
383
- <div class="method-heading">
384
- <span class="method-name">setup_options</span><span
385
- class="method-args">(options)</span>
386
- <span class="method-click-advice">click to toggle source</span>
387
- </div>
388
-
389
-
390
- <div class="method-description">
391
-
392
-
393
-
394
-
395
-
396
- <div class="method-source-code" id="setup_options-source">
397
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 30</span>
398
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">setup_options</span>(<span class="ruby-identifier">options</span>)
399
- <span class="ruby-keyword">super</span>(<span class="ruby-identifier">options</span>)
400
-
401
- <span class="ruby-identifier">filename</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:filename</span>]
402
- <span class="ruby-identifier">template</span> = <span class="ruby-identifier">filename</span> <span class="ruby-operator">?</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">filename</span>).<span class="ruby-identifier">untaint</span> <span class="ruby-operator">:</span> (<span class="ruby-identifier">options</span>[<span class="ruby-value">:template</span>] <span class="ruby-operator">||</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">template</span>)
403
- <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
- <span class="ruby-ivar">@erb</span>.<span class="ruby-identifier">filename</span> = <span class="ruby-identifier">filename</span>
405
- <span class="ruby-keyword">end</span></pre>
406
- </div><!-- setup_options-source -->
407
-
408
- </div>
409
-
410
-
411
-
412
-
413
- </div><!-- setup_options-method -->
414
-
415
-
416
- <div id="method-i-template" class="method-detail ">
417
-
418
- <div class="method-heading">
419
- <span class="method-name">template</span><span
420
- class="method-args">()</span>
421
- <span class="method-click-advice">click to toggle source</span>
422
- </div>
423
-
424
-
425
- <div class="method-description">
426
-
427
-
428
-
429
-
430
-
431
- <div class="method-source-code" id="template-source">
432
- <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 77</span>
433
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">template</span>
434
- <span class="ruby-string">&#39;
435
- &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;
436
- &lt;html&gt;
437
- &lt;head&gt;
438
- &lt;style media=&quot;all&quot; type=&quot;text/css&quot;&gt;
439
- table {
440
- border-collapse: collapse;
441
- border: 1px solid #CCC;
442
- font-family: Verdana, Arial, Helvetica, sans-serif;
443
- font-size: 9pt;
444
- line-height: normal;
445
- width: 100%;
446
- }
447
-
448
- th {
449
- text-align: center;
450
- border-top: 1px solid #FB7A31;
451
- border-bottom: 1px solid #FB7A31;
452
- background: #FFC;
453
- padding: 0.3em;
454
- border-left: 1px solid silver;
455
- }
456
-
457
- tr.break td {
458
- border: 0;
459
- border-top: 1px solid #FB7A31;
460
- padding: 0;
461
- margin: 0;
462
- }
463
-
464
- tr.method td {
465
- font-weight: bold;
466
- }
467
-
468
- td {
469
- padding: 0.3em;
470
- }
471
-
472
- td:first-child {
473
- width: 190px;
474
- }
475
-
476
- td {
477
- border-left: 1px solid #CCC;
478
- text-align: center;
479
- }
480
-
481
- .method_name {
482
- text-align: left;
483
- }
484
-
485
- tfoot td {
486
- text-align: left;
487
- }
488
- &lt;/style&gt;
489
- &lt;/head&gt;
490
- &lt;body&gt;
491
- &lt;h1&gt;Profile Report&lt;/h1&gt;
492
- &lt;!-- Threads Table --&gt;
493
- &lt;table&gt;
494
- &lt;tr&gt;
495
- &lt;th&gt;Thread ID&lt;/th&gt;
496
- &lt;% if RUBY_VERSION &gt;= &quot;1.9&quot; %&gt;
497
- &lt;th&gt;Fiber ID&lt;/th&gt;
498
- &lt;% end %&gt;
499
- &lt;th&gt;Total Time&lt;/th&gt;
500
- &lt;/tr&gt;
501
- &lt;% for thread in @result.threads %&gt;
502
- &lt;tr&gt;
503
- &lt;% if RUBY_VERSION &gt;= &quot;1.9&quot; %&gt;
504
- &lt;td&gt;&lt;%= thread.id %&gt;&lt;/td&gt;
505
- &lt;% end %&gt;
506
- &lt;td&gt;&lt;a href=&quot;#&lt;%= thread.fiber_id %&gt;&quot;&gt;&lt;%= thread.fiber_id %&gt;&lt;/a&gt;&lt;/td&gt;
507
- &lt;td&gt;&lt;%= thread.total_time %&gt;&lt;/td&gt;
508
- &lt;/tr&gt;
509
- &lt;% end %&gt;
510
- &lt;/table&gt;
511
-
512
- &lt;!-- Methods Tables --&gt;
513
- &lt;% for thread in @result.threads
514
- methods = thread.methods
515
- total_time = thread.total_time %&gt;
516
- &lt;% if RUBY_VERSION &gt;= &quot;1.9&quot; %&gt;
517
- &lt;h2&gt;&lt;a name=&quot;&lt;%= thread.fiber_id %&gt;&quot;&gt;Thread &lt;%= thread.id %&gt;, Fiber: &lt;%= thread.fiber_id %&gt;&lt;/a&gt;&lt;/h2&gt;
518
- &lt;% else %&gt;
519
- &lt;h2&gt;&lt;a name=&quot;&lt;%= thread.fiber_id %&gt;&quot;&gt;Thread &lt;%= thread.fiber_id %&gt;&lt;/a&gt;&lt;/h2&gt;
520
- &lt;% end %&gt;
521
- &lt;table&gt;
522
- &lt;thead&gt;
523
- &lt;tr&gt;
524
- &lt;th&gt;&lt;%= sprintf(&quot;%#{PERCENTAGE_WIDTH}s&quot;, &quot;%Total&quot;) %&gt;&lt;/th&gt;
525
- &lt;th&gt;&lt;%= sprintf(&quot;%#{PERCENTAGE_WIDTH}s&quot;, &quot;%Self&quot;) %&gt;&lt;/th&gt;
526
- &lt;th&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}s&quot;, &quot;Total&quot;) %&gt;&lt;/th&gt;
527
- &lt;th&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}s&quot;, &quot;Self&quot;) %&gt;&lt;/th&gt;
528
- &lt;th&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}s&quot;, &quot;Wait&quot;) %&gt;&lt;/th&gt;
529
- &lt;th&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH+2}s&quot;, &quot;Child&quot;) %&gt;&lt;/th&gt;
530
- &lt;th&gt;&lt;%= sprintf(&quot;%#{CALL_WIDTH}s&quot;, &quot;Calls&quot;) %&gt;&lt;/th&gt;
531
- &lt;th class=&quot;method_name&quot;&gt;Name&lt;/th&gt;
532
- &lt;th&gt;Line&lt;/th&gt;
533
- &lt;/tr&gt;
534
- &lt;/thead&gt;
535
-
536
- &lt;tbody&gt;
537
- &lt;% min_time = @options[:min_time] || (@options[:nonzero] ? 0.005 : nil)
538
- methods.sort_by(&amp;sort_method).reverse_each do |method|
539
- total_percentage = (method.total_time/total_time) * 100
540
- next if total_percentage &lt; min_percent
541
- next if min_time &amp;&amp; method.total_time &lt; min_time
542
- self_percentage = (method.self_time/total_time) * 100 %&gt;
543
-
544
- &lt;!-- Parents --&gt;
545
- &lt;% for caller in method.aggregate_parents.sort_by(&amp;:total_time)
546
- next unless caller.parent
547
- next if min_time &amp;&amp; caller.total_time &lt; min_time %&gt;
548
- &lt;tr&gt;
549
- &lt;td&gt;&amp;nbsp;&lt;/td&gt;
550
- &lt;td&gt;&amp;nbsp;&lt;/td&gt;
551
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, caller.total_time) %&gt;&lt;/td&gt;
552
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, caller.self_time) %&gt;&lt;/td&gt;
553
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, caller.wait_time) %&gt;&lt;/td&gt;
554
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, caller.children_time) %&gt;&lt;/td&gt;
555
- &lt;% called = &quot;#{caller.called}/#{method.called}&quot; %&gt;
556
- &lt;td&gt;&lt;%= sprintf(&quot;%#{CALL_WIDTH}s&quot;, called) %&gt;&lt;/td&gt;
557
- &lt;td class=&quot;method_name&quot;&gt;&lt;%= create_link(thread, total_time, caller.parent.target) %&gt;&lt;/td&gt;
558
- &lt;td&gt;&lt;%= file_link(caller.parent.target.source_file, caller.line) %&gt;&lt;/td&gt;
559
- &lt;/tr&gt;
560
- &lt;% end %&gt;
561
-
562
- &lt;tr class=&quot;method&quot;&gt;
563
- &lt;td&gt;&lt;%= sprintf(&quot;%#{PERCENTAGE_WIDTH-1}.2f\%&quot;, total_percentage) %&gt;&lt;/td&gt;
564
- &lt;td&gt;&lt;%= sprintf(&quot;%#{PERCENTAGE_WIDTH-1}.2f\%&quot;, self_percentage) %&gt;&lt;/td&gt;
565
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, method.total_time) %&gt;&lt;/td&gt;
566
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, method.self_time) %&gt;&lt;/td&gt;
567
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, method.wait_time) %&gt;&lt;/td&gt;
568
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, method.children_time) %&gt;&lt;/td&gt;
569
- &lt;td&gt;&lt;%= sprintf(&quot;%#{CALL_WIDTH}i&quot;, method.called) %&gt;&lt;/td&gt;
570
- &lt;td class=&quot;method_name&quot;&gt;
571
- &lt;a name=&quot;&lt;%= method_href(thread, method) %&gt;&quot;&gt;
572
- &lt;%= method.recursive? ? &quot;*&quot; : &quot; &quot;%&gt;&lt;%= h method.full_name %&gt;
573
- &lt;/a&gt;
574
- &lt;/td&gt;
575
- &lt;td&gt;&lt;%= file_link(method.source_file, method.line) %&gt;&lt;/td&gt;
576
- &lt;/tr&gt;
577
-
578
- &lt;!-- Children --&gt;
579
- &lt;% for callee in method.aggregate_children.sort_by(&amp;:total_time).reverse %&gt;
580
- &lt;% next if min_time &amp;&amp; callee.total_time &lt; min_time %&gt;
581
- &lt;tr&gt;
582
- &lt;td&gt;&amp;nbsp;&lt;/td&gt;
583
- &lt;td&gt;&amp;nbsp;&lt;/td&gt;
584
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, callee.total_time) %&gt;&lt;/td&gt;
585
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, callee.self_time) %&gt;&lt;/td&gt;
586
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, callee.wait_time) %&gt;&lt;/td&gt;
587
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, callee.children_time) %&gt;&lt;/td&gt;
588
- &lt;% called = &quot;#{callee.called}/#{callee.target.called}&quot; %&gt;
589
- &lt;td&gt;&lt;%= sprintf(&quot;%#{CALL_WIDTH}s&quot;, called) %&gt;&lt;/td&gt;
590
- &lt;td class=&quot;method_name&quot;&gt;&lt;%= create_link(thread, total_time, callee.target) %&gt;&lt;/td&gt;
591
- &lt;td&gt;&lt;%= file_link(method.source_file, callee.line) %&gt;&lt;/td&gt;
592
- &lt;/tr&gt;
593
- &lt;% end %&gt;
594
- &lt;!-- Create divider row --&gt;
595
- &lt;tr class=&quot;break&quot;&gt;&lt;td colspan=&quot;9&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
596
- &lt;% end %&gt;
597
- &lt;/tbody&gt;
598
- &lt;tfoot&gt;
599
- &lt;tr&gt;
600
- &lt;td colspan=&quot;9&quot;&gt;* indicates recursively called methods&lt;/td&gt;
601
- &lt;/tr&gt;
602
- &lt;/tfoot&gt;
603
- &lt;/table&gt;
604
- &lt;% end %&gt;
605
- &lt;/body&gt;
606
- &lt;/html&gt;&#39;</span>
607
- <span class="ruby-keyword">end</span></pre>
608
- </div><!-- template-source -->
609
-
610
- </div>
611
-
612
-
613
-
614
-
615
- </div><!-- template-method -->
616
-
617
-
618
- </section><!-- public-instance-method-details -->
619
-
620
- </section><!-- 5Buntitled-5D -->
621
-
622
- </div><!-- documentation -->
623
-
624
-
625
- <footer id="validator-badges">
626
- <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
627
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
628
- <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
629
- </footer>
630
-