ruby-prof 0.15.4 → 0.15.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +7 -1
- data/README.rdoc +1 -1
- data/bin/ruby-prof +16 -4
- data/doc/LICENSE.html +114 -0
- data/doc/README_rdoc.html +592 -0
- data/doc/Rack.html +95 -0
- data/doc/Rack/RubyProf.html +264 -0
- data/doc/RubyProf.html +962 -0
- data/doc/RubyProf/AbstractPrinter.html +546 -0
- data/doc/RubyProf/AggregateCallInfo.html +537 -0
- data/doc/RubyProf/CallInfo.html +468 -0
- data/doc/RubyProf/CallInfoPrinter.html +120 -0
- data/doc/RubyProf/CallInfoVisitor.html +200 -0
- data/doc/RubyProf/CallStackPrinter.html +1604 -0
- data/doc/RubyProf/CallTreePrinter.html +359 -0
- data/doc/RubyProf/Cmd.html +631 -0
- data/doc/RubyProf/DotPrinter.html +257 -0
- data/doc/RubyProf/FlatPrinter.html +163 -0
- data/doc/RubyProf/FlatPrinterWithLineNumbers.html +208 -0
- data/doc/RubyProf/GraphHtmlPrinter.html +575 -0
- data/doc/RubyProf/GraphPrinter.html +139 -0
- data/doc/RubyProf/MethodInfo.html +685 -0
- data/doc/RubyProf/MultiPrinter.html +358 -0
- data/doc/RubyProf/Profile.html +764 -0
- data/doc/RubyProf/ProfileTask.html +490 -0
- data/doc/RubyProf/Thread.html +199 -0
- data/doc/created.rid +14 -14
- data/doc/examples/flat_txt.html +149 -0
- data/doc/examples/graph_html.html +850 -0
- data/doc/examples/graph_txt.html +274 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +618 -0
- data/doc/js/search_index.js.gz +0 -0
- data/doc/table_of_contents.html +859 -0
- data/lib/ruby-prof/printers/flat_printer_with_line_numbers.rb +21 -14
- data/lib/ruby-prof/printers/graph_printer.rb +1 -0
- data/lib/ruby-prof/version.rb +1 -1
- data/test/measure_cpu_time_test.rb +1 -1
- metadata +54 -2
@@ -25,7 +25,7 @@ module RubyProf
|
|
25
25
|
#self_time_called = method.called > 0 ? method.self_time/method.called : 0
|
26
26
|
#total_time_called = method.called > 0? method.total_time/method.called : 0
|
27
27
|
|
28
|
-
@output << "%6.2f %9.3f %9.3f %9.3f %9.3f %8d %s%s
|
28
|
+
@output << "%6.2f %9.3f %9.3f %9.3f %9.3f %8d %s%s" % [
|
29
29
|
method.self_time / total_time * 100, # %self
|
30
30
|
method.total_time, # total
|
31
31
|
method.self_time, # self
|
@@ -35,23 +35,30 @@ module RubyProf
|
|
35
35
|
method.recursive? ? "*" : " ", # cycle
|
36
36
|
method_name(method) # name
|
37
37
|
]
|
38
|
-
if method.source_file
|
39
|
-
@output << "
|
38
|
+
if method.source_file == 'ruby_runtime'
|
39
|
+
@output << "\n"
|
40
|
+
else
|
41
|
+
@output << "\n defined at:\n"
|
42
|
+
@output << " %s:%s\n" % [File.expand_path(method.source_file), method.line]
|
40
43
|
end
|
41
|
-
@output << "\n\tcalled from: "
|
42
44
|
|
43
|
-
|
44
|
-
method.call_infos.
|
45
|
+
callers = []
|
46
|
+
method.call_infos.each do |ci|
|
45
47
|
if ci.parent && ci.parent.target.source_file != 'ruby_runtime'
|
46
|
-
|
47
|
-
else
|
48
|
-
nil
|
48
|
+
callers << [method_name(ci.parent.target), File.expand_path(ci.parent.target.source_file), ci.parent.target.line]
|
49
49
|
end
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
end
|
51
|
+
# make sure callers are unique
|
52
|
+
callers.uniq!
|
53
|
+
|
54
|
+
unless callers.empty?
|
55
|
+
@output << " called from:\n"
|
56
|
+
callers.each do |args|
|
57
|
+
@output << " %s (%s:%s)\n" % args
|
58
|
+
end
|
59
|
+
end
|
60
|
+
@output << "\n"
|
54
61
|
end
|
55
62
|
end
|
56
63
|
end
|
57
|
-
end
|
64
|
+
end
|
@@ -21,6 +21,7 @@ module RubyProf
|
|
21
21
|
private
|
22
22
|
|
23
23
|
def print_header(thread)
|
24
|
+
@output << "Measure Mode: %s\n" % RubyProf.measure_mode_string
|
24
25
|
@output << "Thread ID: #{thread.id}\n"
|
25
26
|
@output << "Fiber ID: #{thread.fiber_id}\n" unless thread.id == thread.fiber_id
|
26
27
|
@output << "Total Time: #{thread.total_time}\n"
|
data/lib/ruby-prof/version.rb
CHANGED
@@ -121,7 +121,7 @@ class MeasureCpuTimeTest < TestCase
|
|
121
121
|
|
122
122
|
assert_in_delta(0.3, methods[1].total_time, 0.02)
|
123
123
|
assert_in_delta(0, methods[1].wait_time, 0.01)
|
124
|
-
assert_in_delta(0, methods[1].self_time, 0.
|
124
|
+
assert_in_delta(0, methods[1].self_time, 0.1)
|
125
125
|
end
|
126
126
|
|
127
127
|
def test_singleton
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-prof
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shugo Maeda, Charlie Savage, Roger Pack, Stefan Kaes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -73,16 +73,67 @@ files:
|
|
73
73
|
- Rakefile
|
74
74
|
- bin/ruby-prof
|
75
75
|
- bin/ruby-prof-check-trace
|
76
|
+
- doc/LICENSE.html
|
77
|
+
- doc/README_rdoc.html
|
78
|
+
- doc/Rack.html
|
79
|
+
- doc/Rack/RubyProf.html
|
80
|
+
- doc/RubyProf.html
|
81
|
+
- doc/RubyProf/AbstractPrinter.html
|
82
|
+
- doc/RubyProf/AggregateCallInfo.html
|
83
|
+
- doc/RubyProf/CallInfo.html
|
84
|
+
- doc/RubyProf/CallInfoPrinter.html
|
85
|
+
- doc/RubyProf/CallInfoVisitor.html
|
86
|
+
- doc/RubyProf/CallStackPrinter.html
|
87
|
+
- doc/RubyProf/CallTreePrinter.html
|
88
|
+
- doc/RubyProf/Cmd.html
|
89
|
+
- doc/RubyProf/DotPrinter.html
|
90
|
+
- doc/RubyProf/FlatPrinter.html
|
91
|
+
- doc/RubyProf/FlatPrinterWithLineNumbers.html
|
92
|
+
- doc/RubyProf/GraphHtmlPrinter.html
|
93
|
+
- doc/RubyProf/GraphPrinter.html
|
94
|
+
- doc/RubyProf/MethodInfo.html
|
95
|
+
- doc/RubyProf/MultiPrinter.html
|
96
|
+
- doc/RubyProf/Profile.html
|
97
|
+
- doc/RubyProf/ProfileTask.html
|
98
|
+
- doc/RubyProf/Thread.html
|
76
99
|
- doc/created.rid
|
77
100
|
- doc/css/fonts.css
|
78
101
|
- doc/css/rdoc.css
|
102
|
+
- doc/examples/flat_txt.html
|
103
|
+
- doc/examples/graph_html.html
|
104
|
+
- doc/examples/graph_txt.html
|
79
105
|
- doc/fonts/Lato-Light.ttf
|
80
106
|
- doc/fonts/Lato-LightItalic.ttf
|
81
107
|
- doc/fonts/Lato-Regular.ttf
|
82
108
|
- doc/fonts/Lato-RegularItalic.ttf
|
83
109
|
- doc/fonts/SourceCodePro-Bold.ttf
|
84
110
|
- doc/fonts/SourceCodePro-Regular.ttf
|
111
|
+
- doc/images/add.png
|
112
|
+
- doc/images/arrow_up.png
|
113
|
+
- doc/images/brick.png
|
114
|
+
- doc/images/brick_link.png
|
115
|
+
- doc/images/bug.png
|
116
|
+
- doc/images/bullet_black.png
|
117
|
+
- doc/images/bullet_toggle_minus.png
|
118
|
+
- doc/images/bullet_toggle_plus.png
|
119
|
+
- doc/images/date.png
|
120
|
+
- doc/images/delete.png
|
121
|
+
- doc/images/find.png
|
85
122
|
- doc/images/loadingAnimation.gif
|
123
|
+
- doc/images/macFFBgHack.png
|
124
|
+
- doc/images/package.png
|
125
|
+
- doc/images/page_green.png
|
126
|
+
- doc/images/page_white_text.png
|
127
|
+
- doc/images/page_white_width.png
|
128
|
+
- doc/images/plugin.png
|
129
|
+
- doc/images/ruby.png
|
130
|
+
- doc/images/tag_blue.png
|
131
|
+
- doc/images/tag_green.png
|
132
|
+
- doc/images/transparent.png
|
133
|
+
- doc/images/wrench.png
|
134
|
+
- doc/images/wrench_orange.png
|
135
|
+
- doc/images/zoom.png
|
136
|
+
- doc/index.html
|
86
137
|
- doc/js/darkfish.js
|
87
138
|
- doc/js/jquery.js
|
88
139
|
- doc/js/navigation.js
|
@@ -92,6 +143,7 @@ files:
|
|
92
143
|
- doc/js/search_index.js.gz
|
93
144
|
- doc/js/searcher.js
|
94
145
|
- doc/js/searcher.js.gz
|
146
|
+
- doc/table_of_contents.html
|
95
147
|
- examples/empty.png
|
96
148
|
- examples/flat.txt
|
97
149
|
- examples/graph.dot
|