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
data/doc/Rack.html
CHANGED
@@ -2,143 +2,76 @@
|
|
2
2
|
|
3
3
|
<html>
|
4
4
|
<head>
|
5
|
-
<meta
|
5
|
+
<meta charset="UTF-8">
|
6
6
|
|
7
7
|
<title>module Rack - 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="module">
|
24
|
-
<nav
|
25
|
-
<
|
26
|
-
|
27
|
-
|
24
|
+
<body id="top" role="document" class="module">
|
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>
|
46
|
+
</div>
|
44
47
|
|
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>
|
45
53
|
|
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/rack.rb
|
51
|
-
</ul>
|
52
|
-
</nav>
|
53
|
-
|
54
|
-
|
55
54
|
</div>
|
56
55
|
|
56
|
+
|
57
|
+
|
57
58
|
<div id="class-metadata">
|
58
59
|
|
59
60
|
|
60
61
|
|
61
62
|
|
62
|
-
|
63
|
-
|
64
|
-
<div id="project-metadata">
|
65
|
-
<nav id="fileindex-section" class="section project-section">
|
66
|
-
<h3 class="section-header">Pages</h3>
|
67
|
-
|
68
|
-
<ul>
|
69
|
-
|
70
|
-
<li class="file"><a href="./LICENSE.html">LICENSE</a>
|
71
|
-
|
72
|
-
<li class="file"><a href="./README_rdoc.html">README</a>
|
73
|
-
|
74
|
-
<li class="file"><a href="./examples/flat_txt.html">flat</a>
|
75
|
-
|
76
|
-
<li class="file"><a href="./examples/graph_txt.html">graph</a>
|
77
|
-
|
78
|
-
</ul>
|
79
|
-
</nav>
|
80
|
-
|
81
|
-
<nav id="classindex-section" class="section project-section">
|
82
|
-
<h3 class="section-header">Class and Module Index</h3>
|
83
|
-
|
84
|
-
<ul class="link-list">
|
85
|
-
|
86
|
-
<li><a href="./RubyProf.html">RubyProf</a>
|
87
|
-
|
88
|
-
<li><a href="./RubyProf/AbstractPrinter.html">RubyProf::AbstractPrinter</a>
|
89
|
-
|
90
|
-
<li><a href="./RubyProf/AggregateCallInfo.html">RubyProf::AggregateCallInfo</a>
|
91
|
-
|
92
|
-
<li><a href="./RubyProf/CallInfo.html">RubyProf::CallInfo</a>
|
93
|
-
|
94
|
-
<li><a href="./RubyProf/CallInfoPrinter.html">RubyProf::CallInfoPrinter</a>
|
95
|
-
|
96
|
-
<li><a href="./RubyProf/CallInfoVisitor.html">RubyProf::CallInfoVisitor</a>
|
97
|
-
|
98
|
-
<li><a href="./RubyProf/CallStackPrinter.html">RubyProf::CallStackPrinter</a>
|
99
|
-
|
100
|
-
<li><a href="./RubyProf/CallTreePrinter.html">RubyProf::CallTreePrinter</a>
|
101
|
-
|
102
|
-
<li><a href="./RubyProf/Cmd.html">RubyProf::Cmd</a>
|
103
|
-
|
104
|
-
<li><a href="./RubyProf/DotPrinter.html">RubyProf::DotPrinter</a>
|
105
|
-
|
106
|
-
<li><a href="./RubyProf/FlatPrinter.html">RubyProf::FlatPrinter</a>
|
107
|
-
|
108
|
-
<li><a href="./RubyProf/FlatPrinterWithLineNumbers.html">RubyProf::FlatPrinterWithLineNumbers</a>
|
109
|
-
|
110
|
-
<li><a href="./RubyProf/GraphHtmlPrinter.html">RubyProf::GraphHtmlPrinter</a>
|
111
|
-
|
112
|
-
<li><a href="./RubyProf/GraphPrinter.html">RubyProf::GraphPrinter</a>
|
113
|
-
|
114
|
-
<li><a href="./RubyProf/MethodInfo.html">RubyProf::MethodInfo</a>
|
115
|
-
|
116
|
-
<li><a href="./RubyProf/MultiPrinter.html">RubyProf::MultiPrinter</a>
|
117
|
-
|
118
|
-
<li><a href="./RubyProf/Profile.html">RubyProf::Profile</a>
|
119
|
-
|
120
|
-
<li><a href="./RubyProf/ProfileTask.html">RubyProf::ProfileTask</a>
|
121
|
-
|
122
|
-
<li><a href="./RubyProf/Test.html">RubyProf::Test</a>
|
123
|
-
|
124
|
-
<li><a href="./RubyProf/Thread.html">RubyProf::Thread</a>
|
125
|
-
|
126
|
-
<li><a href="./Rack.html">Rack</a>
|
127
|
-
|
128
|
-
<li><a href="./Rack/RubyProf.html">Rack::RubyProf</a>
|
129
|
-
|
130
|
-
</ul>
|
131
|
-
</nav>
|
132
|
-
|
63
|
+
|
133
64
|
</div>
|
134
65
|
</nav>
|
135
66
|
|
136
|
-
<
|
137
|
-
<h1 class="module">
|
67
|
+
<main role="main" aria-labelledby="module-Rack">
|
68
|
+
<h1 id="module-Rack" class="module">
|
69
|
+
module Rack
|
70
|
+
</h1>
|
138
71
|
|
139
|
-
<
|
72
|
+
<section class="description">
|
140
73
|
|
141
|
-
</
|
74
|
+
</section>
|
142
75
|
|
143
76
|
|
144
77
|
|
@@ -152,16 +85,14 @@
|
|
152
85
|
|
153
86
|
|
154
87
|
|
155
|
-
<!-- Methods -->
|
156
88
|
|
157
|
-
</section
|
158
|
-
|
159
|
-
</div><!-- documentation -->
|
89
|
+
</section>
|
90
|
+
</main>
|
160
91
|
|
161
92
|
|
162
|
-
<footer id="validator-badges">
|
163
|
-
<p><a href="http://validator.w3.org/check/referer">
|
164
|
-
<p>Generated by <a href="
|
165
|
-
<p>
|
93
|
+
<footer id="validator-badges" role="contentinfo">
|
94
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
95
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
96
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
166
97
|
</footer>
|
167
98
|
|
data/doc/Rack/RubyProf.html
CHANGED
@@ -2,163 +2,97 @@
|
|
2
2
|
|
3
3
|
<html>
|
4
4
|
<head>
|
5
|
-
<meta
|
5
|
+
<meta charset="UTF-8">
|
6
6
|
|
7
7
|
<title>class Rack::RubyProf - 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/rack.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">Object
|
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-c-new">::new</a>
|
76
|
+
<li ><a href="#method-c-new">::new</a>
|
74
77
|
|
75
|
-
<li><a href="#method-i-call">#call</a>
|
78
|
+
<li ><a href="#method-i-call">#call</a>
|
76
79
|
|
77
|
-
<li><a href="#method-i-print">#print</a>
|
80
|
+
<li ><a href="#method-i-print">#print</a>
|
78
81
|
|
79
82
|
</ul>
|
80
|
-
</
|
81
|
-
|
82
|
-
</div>
|
83
|
-
|
84
|
-
<div id="project-metadata">
|
85
|
-
<nav id="fileindex-section" class="section project-section">
|
86
|
-
<h3 class="section-header">Pages</h3>
|
87
|
-
|
88
|
-
<ul>
|
89
|
-
|
90
|
-
<li class="file"><a href="../LICENSE.html">LICENSE</a>
|
91
|
-
|
92
|
-
<li class="file"><a href="../README_rdoc.html">README</a>
|
93
|
-
|
94
|
-
<li class="file"><a href="../examples/flat_txt.html">flat</a>
|
95
|
-
|
96
|
-
<li class="file"><a href="../examples/graph_txt.html">graph</a>
|
97
|
-
|
98
|
-
</ul>
|
99
|
-
</nav>
|
100
|
-
|
101
|
-
<nav id="classindex-section" class="section project-section">
|
102
|
-
<h3 class="section-header">Class and Module Index</h3>
|
103
|
-
|
104
|
-
<ul class="link-list">
|
105
|
-
|
106
|
-
<li><a href="../RubyProf.html">RubyProf</a>
|
107
|
-
|
108
|
-
<li><a href="../RubyProf/AbstractPrinter.html">RubyProf::AbstractPrinter</a>
|
109
|
-
|
110
|
-
<li><a href="../RubyProf/AggregateCallInfo.html">RubyProf::AggregateCallInfo</a>
|
111
|
-
|
112
|
-
<li><a href="../RubyProf/CallInfo.html">RubyProf::CallInfo</a>
|
113
|
-
|
114
|
-
<li><a href="../RubyProf/CallInfoPrinter.html">RubyProf::CallInfoPrinter</a>
|
115
|
-
|
116
|
-
<li><a href="../RubyProf/CallInfoVisitor.html">RubyProf::CallInfoVisitor</a>
|
117
|
-
|
118
|
-
<li><a href="../RubyProf/CallStackPrinter.html">RubyProf::CallStackPrinter</a>
|
119
|
-
|
120
|
-
<li><a href="../RubyProf/CallTreePrinter.html">RubyProf::CallTreePrinter</a>
|
121
|
-
|
122
|
-
<li><a href="../RubyProf/Cmd.html">RubyProf::Cmd</a>
|
123
|
-
|
124
|
-
<li><a href="../RubyProf/DotPrinter.html">RubyProf::DotPrinter</a>
|
125
|
-
|
126
|
-
<li><a href="../RubyProf/FlatPrinter.html">RubyProf::FlatPrinter</a>
|
127
|
-
|
128
|
-
<li><a href="../RubyProf/FlatPrinterWithLineNumbers.html">RubyProf::FlatPrinterWithLineNumbers</a>
|
129
|
-
|
130
|
-
<li><a href="../RubyProf/GraphHtmlPrinter.html">RubyProf::GraphHtmlPrinter</a>
|
131
|
-
|
132
|
-
<li><a href="../RubyProf/GraphPrinter.html">RubyProf::GraphPrinter</a>
|
133
|
-
|
134
|
-
<li><a href="../RubyProf/MethodInfo.html">RubyProf::MethodInfo</a>
|
135
|
-
|
136
|
-
<li><a href="../RubyProf/MultiPrinter.html">RubyProf::MultiPrinter</a>
|
137
|
-
|
138
|
-
<li><a href="../RubyProf/Profile.html">RubyProf::Profile</a>
|
139
|
-
|
140
|
-
<li><a href="../RubyProf/ProfileTask.html">RubyProf::ProfileTask</a>
|
141
|
-
|
142
|
-
<li><a href="../RubyProf/Test.html">RubyProf::Test</a>
|
143
|
-
|
144
|
-
<li><a href="../RubyProf/Thread.html">RubyProf::Thread</a>
|
145
|
-
|
146
|
-
<li><a href="../Rack.html">Rack</a>
|
147
|
-
|
148
|
-
<li><a href="../Rack/RubyProf.html">Rack::RubyProf</a>
|
149
|
-
|
150
|
-
</ul>
|
151
|
-
</nav>
|
83
|
+
</div>
|
152
84
|
|
153
85
|
</div>
|
154
86
|
</nav>
|
155
87
|
|
156
|
-
<
|
157
|
-
<h1
|
88
|
+
<main role="main" aria-labelledby="class-Rack::RubyProf">
|
89
|
+
<h1 id="class-Rack::RubyProf" class="class">
|
90
|
+
class Rack::RubyProf
|
91
|
+
</h1>
|
158
92
|
|
159
|
-
<
|
93
|
+
<section class="description">
|
160
94
|
|
161
|
-
</
|
95
|
+
</section>
|
162
96
|
|
163
97
|
|
164
98
|
|
@@ -172,10 +106,11 @@
|
|
172
106
|
|
173
107
|
|
174
108
|
|
175
|
-
<!-- Methods -->
|
176
109
|
|
177
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section
|
178
|
-
|
110
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
111
|
+
<header>
|
112
|
+
<h3>Public Class Methods</h3>
|
113
|
+
</header>
|
179
114
|
|
180
115
|
|
181
116
|
<div id="method-c-new" class="method-detail ">
|
@@ -183,7 +118,9 @@
|
|
183
118
|
<div class="method-heading">
|
184
119
|
<span class="method-name">new</span><span
|
185
120
|
class="method-args">(app, options = {})</span>
|
121
|
+
|
186
122
|
<span class="method-click-advice">click to toggle source</span>
|
123
|
+
|
187
124
|
</div>
|
188
125
|
|
189
126
|
|
@@ -191,36 +128,39 @@
|
|
191
128
|
|
192
129
|
|
193
130
|
|
131
|
+
|
194
132
|
|
195
133
|
|
196
134
|
<div class="method-source-code" id="new-source">
|
197
135
|
<pre><span class="ruby-comment"># File lib/ruby-prof/rack.rb, line 5</span>
|
198
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">app</span>, <span class="ruby-identifier">options</span> = {})
|
199
|
-
<span class="ruby-ivar">@app</span> = <span class="ruby-identifier">app</span>
|
200
|
-
<span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>
|
201
|
-
<span class="ruby-ivar">@options</span>[<span class="ruby-value">:min_percent</span>] <span class="ruby-operator">||=</span> <span class="ruby-value">1</span>
|
202
|
-
<span class="ruby-ivar">@tmpdir</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:path</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">tmpdir</span>
|
203
|
-
<span class="ruby-ivar">@printer_klasses</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-value">:printers</span>] <span class="ruby-operator">||</span> {<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">FlatPrinter</span> =<span class="ruby-operator">></span> <span class="ruby-string">'flat.txt'</span>,
|
204
|
-
<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">GraphPrinter</span> =<span class="ruby-operator">></span> <span class="ruby-string">'graph.txt'</span>,
|
205
|
-
<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">GraphHtmlPrinter</span> =<span class="ruby-operator">></span> <span class="ruby-string">'graph.html'</span>,
|
206
|
-
<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">CallStackPrinter</span> =<span class="ruby-operator">></span> <span class="ruby-string">'call_stack.html'</span>}
|
207
|
-
|
208
|
-
<span class="ruby-ivar">@skip_paths</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:skip_paths</span>] <span class="ruby-operator">||</span> [<span class="ruby-regexp">%r{^/assets}</span>, <span class="ruby-regexp">%r{\.css$}</span>, <span class="ruby-regexp">%r{\.js$}</span>, <span class="ruby-regexp">%r{\.png$}</span>, <span class="ruby-regexp">%r{\.jpeg$}</span>, <span class="ruby-regexp">%r{\.jpg$}</span>, <span class="ruby-regexp">%r{\.gif$}</span>]
|
136
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">app</span>, <span class="ruby-identifier">options</span> = {})
|
137
|
+
<span class="ruby-ivar">@app</span> = <span class="ruby-identifier">app</span>
|
138
|
+
<span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>
|
139
|
+
<span class="ruby-ivar">@options</span>[<span class="ruby-value">:min_percent</span>] <span class="ruby-operator">||=</span> <span class="ruby-value">1</span>
|
140
|
+
<span class="ruby-ivar">@tmpdir</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:path</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">tmpdir</span>
|
141
|
+
<span class="ruby-ivar">@printer_klasses</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-value">:printers</span>] <span class="ruby-operator">||</span> {<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">FlatPrinter</span> =<span class="ruby-operator">></span> <span class="ruby-string">'flat.txt'</span>,
|
142
|
+
<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">GraphPrinter</span> =<span class="ruby-operator">></span> <span class="ruby-string">'graph.txt'</span>,
|
143
|
+
<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">GraphHtmlPrinter</span> =<span class="ruby-operator">></span> <span class="ruby-string">'graph.html'</span>,
|
144
|
+
<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">CallStackPrinter</span> =<span class="ruby-operator">></span> <span class="ruby-string">'call_stack.html'</span>}
|
145
|
+
|
146
|
+
<span class="ruby-ivar">@skip_paths</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:skip_paths</span>] <span class="ruby-operator">||</span> [<span class="ruby-regexp">%r{^/assets}</span>, <span class="ruby-regexp">%r{\.css$}</span>, <span class="ruby-regexp">%r{\.js$}</span>, <span class="ruby-regexp">%r{\.png$}</span>, <span class="ruby-regexp">%r{\.jpeg$}</span>, <span class="ruby-regexp">%r{\.jpg$}</span>, <span class="ruby-regexp">%r{\.gif$}</span>]
|
209
147
|
<span class="ruby-keyword">end</span></pre>
|
210
|
-
</div
|
148
|
+
</div>
|
211
149
|
|
212
150
|
</div>
|
213
151
|
|
214
152
|
|
215
153
|
|
216
154
|
|
217
|
-
</div
|
155
|
+
</div>
|
218
156
|
|
219
157
|
|
220
|
-
</section
|
158
|
+
</section>
|
221
159
|
|
222
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section
|
223
|
-
|
160
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
161
|
+
<header>
|
162
|
+
<h3>Public Instance Methods</h3>
|
163
|
+
</header>
|
224
164
|
|
225
165
|
|
226
166
|
<div id="method-i-call" class="method-detail ">
|
@@ -228,7 +168,9 @@
|
|
228
168
|
<div class="method-heading">
|
229
169
|
<span class="method-name">call</span><span
|
230
170
|
class="method-args">(env)</span>
|
171
|
+
|
231
172
|
<span class="method-click-advice">click to toggle source</span>
|
173
|
+
|
232
174
|
</div>
|
233
175
|
|
234
176
|
|
@@ -236,36 +178,37 @@
|
|
236
178
|
|
237
179
|
|
238
180
|
|
181
|
+
|
239
182
|
|
240
183
|
|
241
184
|
<div class="method-source-code" id="call-source">
|
242
185
|
<pre><span class="ruby-comment"># File lib/ruby-prof/rack.rb, line 18</span>
|
243
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
|
244
|
-
<span class="ruby-identifier">request</span> = <span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">Request</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">env</span>)
|
245
|
-
|
246
|
-
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@skip_paths</span>.<span class="ruby-identifier">any?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">skip_path</span><span class="ruby-operator">|</span> <span class="ruby-identifier">skip_path</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">path</span>}
|
247
|
-
<span class="ruby-ivar">@app</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
|
248
|
-
<span class="ruby-keyword">else</span>
|
249
|
-
<span class="ruby-identifier">result</span> = <span class="ruby-keyword">nil</span>
|
250
|
-
<span class="ruby-identifier">data</span> = <span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">Profile</span>.<span class="ruby-identifier">profile</span> <span class="ruby-keyword">do</span>
|
251
|
-
<span class="ruby-identifier">result</span> = <span class="ruby-ivar">@app</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
|
252
|
-
<span class="ruby-keyword">end</span>
|
253
|
-
|
254
|
-
<span class="ruby-identifier">path</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string">'/'</span>, <span class="ruby-string">'-'</span>)
|
255
|
-
<span class="ruby-identifier">path</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">0</span>)
|
256
|
-
|
257
|
-
<span class="ruby-identifier">print</span>(<span class="ruby-identifier">data</span>, <span class="ruby-identifier">path</span>)
|
258
|
-
<span class="ruby-identifier">result</span>
|
259
|
-
<span class="ruby-keyword">end</span>
|
186
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
|
187
|
+
<span class="ruby-identifier">request</span> = <span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">Request</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">env</span>)
|
188
|
+
|
189
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@skip_paths</span>.<span class="ruby-identifier">any?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">skip_path</span><span class="ruby-operator">|</span> <span class="ruby-identifier">skip_path</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">path</span>}
|
190
|
+
<span class="ruby-ivar">@app</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
|
191
|
+
<span class="ruby-keyword">else</span>
|
192
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-keyword">nil</span>
|
193
|
+
<span class="ruby-identifier">data</span> = <span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">Profile</span>.<span class="ruby-identifier">profile</span> <span class="ruby-keyword">do</span>
|
194
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-ivar">@app</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
|
195
|
+
<span class="ruby-keyword">end</span>
|
196
|
+
|
197
|
+
<span class="ruby-identifier">path</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string">'/'</span>, <span class="ruby-string">'-'</span>)
|
198
|
+
<span class="ruby-identifier">path</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">0</span>)
|
199
|
+
|
200
|
+
<span class="ruby-identifier">print</span>(<span class="ruby-identifier">data</span>, <span class="ruby-identifier">path</span>)
|
201
|
+
<span class="ruby-identifier">result</span>
|
202
|
+
<span class="ruby-keyword">end</span>
|
260
203
|
<span class="ruby-keyword">end</span></pre>
|
261
|
-
</div
|
204
|
+
</div>
|
262
205
|
|
263
206
|
</div>
|
264
207
|
|
265
208
|
|
266
209
|
|
267
210
|
|
268
|
-
</div
|
211
|
+
</div>
|
269
212
|
|
270
213
|
|
271
214
|
<div id="method-i-print" class="method-detail ">
|
@@ -273,7 +216,9 @@
|
|
273
216
|
<div class="method-heading">
|
274
217
|
<span class="method-name">print</span><span
|
275
218
|
class="method-args">(data, path)</span>
|
219
|
+
|
276
220
|
<span class="method-click-advice">click to toggle source</span>
|
221
|
+
|
277
222
|
</div>
|
278
223
|
|
279
224
|
|
@@ -281,39 +226,39 @@
|
|
281
226
|
|
282
227
|
|
283
228
|
|
229
|
+
|
284
230
|
|
285
231
|
|
286
232
|
<div class="method-source-code" id="print-source">
|
287
233
|
<pre><span class="ruby-comment"># File lib/ruby-prof/rack.rb, line 37</span>
|
288
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print</span>(<span class="ruby-identifier">data</span>, <span class="ruby-identifier">path</span>)
|
289
|
-
<span class="ruby-ivar">@printer_klasses</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">printer_klass</span>, <span class="ruby-identifier">base_name</span><span class="ruby-operator">|</span>
|
290
|
-
<span class="ruby-identifier">printer</span> = <span class="ruby-identifier">printer_klass</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">data</span>)
|
291
|
-
<span class="ruby-identifier">file_name</span> = <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@tmpdir</span>, <span class="ruby-node">"#{path}-#{base_name}"</span>)
|
292
|
-
<span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">file_name</span>, <span class="ruby-string">'wb'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
|
293
|
-
<span class="ruby-identifier">printer</span>.<span class="ruby-identifier">print</span>(<span class="ruby-identifier">file</span>, <span class="ruby-ivar">@options</span>)
|
294
|
-
<span class="ruby-keyword">end</span>
|
295
|
-
<span class="ruby-keyword">end</span>
|
234
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print</span>(<span class="ruby-identifier">data</span>, <span class="ruby-identifier">path</span>)
|
235
|
+
<span class="ruby-ivar">@printer_klasses</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">printer_klass</span>, <span class="ruby-identifier">base_name</span><span class="ruby-operator">|</span>
|
236
|
+
<span class="ruby-identifier">printer</span> = <span class="ruby-identifier">printer_klass</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">data</span>)
|
237
|
+
<span class="ruby-identifier">file_name</span> = <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@tmpdir</span>, <span class="ruby-node">"#{path}-#{base_name}"</span>)
|
238
|
+
<span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">file_name</span>, <span class="ruby-string">'wb'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
|
239
|
+
<span class="ruby-identifier">printer</span>.<span class="ruby-identifier">print</span>(<span class="ruby-identifier">file</span>, <span class="ruby-ivar">@options</span>)
|
240
|
+
<span class="ruby-keyword">end</span>
|
241
|
+
<span class="ruby-keyword">end</span>
|
296
242
|
<span class="ruby-keyword">end</span></pre>
|
297
|
-
</div
|
243
|
+
</div>
|
298
244
|
|
299
245
|
</div>
|
300
246
|
|
301
247
|
|
302
248
|
|
303
249
|
|
304
|
-
</div
|
250
|
+
</div>
|
305
251
|
|
306
252
|
|
307
|
-
</section
|
253
|
+
</section>
|
308
254
|
|
309
|
-
</section
|
310
|
-
|
311
|
-
</div><!-- documentation -->
|
255
|
+
</section>
|
256
|
+
</main>
|
312
257
|
|
313
258
|
|
314
|
-
<footer id="validator-badges">
|
315
|
-
<p><a href="http://validator.w3.org/check/referer">
|
316
|
-
<p>Generated by <a href="
|
317
|
-
<p>
|
259
|
+
<footer id="validator-badges" role="contentinfo">
|
260
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
261
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
262
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
318
263
|
</footer>
|
319
264
|
|