ruby-prof 0.8.1-x86-mingw32 → 0.11.0.rc1-x86-mingw32
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.
- data/CHANGES +89 -13
- data/LICENSE +4 -3
- data/{README → README.rdoc} +155 -162
- data/Rakefile +50 -123
- data/bin/ruby-prof +86 -47
- data/examples/empty.png +0 -0
- data/examples/graph.dot +106 -0
- data/examples/graph.png +0 -0
- data/examples/minus.png +0 -0
- data/examples/multi.flat.txt +23 -0
- data/examples/multi.graph.html +906 -0
- data/examples/multi.grind.dat +194 -0
- data/examples/multi.stack.html +573 -0
- data/examples/plus.png +0 -0
- data/examples/stack.html +573 -0
- data/ext/ruby_prof/extconf.rb +53 -0
- data/ext/ruby_prof/rp_call_info.c +369 -0
- data/ext/ruby_prof/rp_call_info.h +46 -0
- data/ext/ruby_prof/rp_measure.c +48 -0
- data/ext/ruby_prof/rp_measure.h +45 -0
- data/ext/ruby_prof/rp_measure_allocations.c +86 -0
- data/ext/ruby_prof/rp_measure_cpu_time.c +112 -0
- data/ext/ruby_prof/rp_measure_gc_runs.c +87 -0
- data/ext/ruby_prof/rp_measure_gc_time.c +73 -0
- data/ext/ruby_prof/rp_measure_memory.c +81 -0
- data/ext/ruby_prof/rp_measure_process_time.c +71 -0
- data/ext/ruby_prof/rp_measure_wall_time.c +42 -0
- data/ext/ruby_prof/rp_method.c +363 -0
- data/ext/ruby_prof/rp_method.h +55 -0
- data/ext/ruby_prof/rp_stack.c +61 -0
- data/ext/ruby_prof/rp_stack.h +40 -0
- data/ext/ruby_prof/rp_thread.c +113 -0
- data/ext/ruby_prof/rp_thread.h +20 -0
- data/ext/ruby_prof/ruby_prof.c +332 -1377
- data/ext/ruby_prof/ruby_prof.h +54 -188
- data/ext/ruby_prof/version.h +6 -3
- data/lib/1.8/ruby_prof.so +0 -0
- data/lib/1.9/ruby_prof.exp +0 -0
- data/lib/1.9/ruby_prof.ilk +0 -0
- data/lib/1.9/ruby_prof.lib +0 -0
- data/lib/1.9/ruby_prof.pdb +0 -0
- data/lib/1.9/ruby_prof.so +0 -0
- data/lib/ruby-prof.rb +32 -18
- data/lib/ruby-prof/abstract_printer.rb +15 -5
- data/lib/ruby-prof/aggregate_call_info.rb +11 -3
- data/lib/ruby-prof/call_info.rb +68 -1
- data/lib/ruby-prof/call_stack_printer.rb +775 -0
- data/lib/ruby-prof/call_tree_printer.rb +17 -9
- data/lib/ruby-prof/compatibility.rb +134 -0
- data/lib/ruby-prof/dot_printer.rb +152 -0
- data/lib/ruby-prof/empty.png +0 -0
- data/lib/ruby-prof/flat_printer.rb +23 -24
- data/lib/ruby-prof/flat_printer_with_line_numbers.rb +17 -21
- data/lib/ruby-prof/graph_html_printer.rb +69 -39
- data/lib/ruby-prof/graph_printer.rb +35 -35
- data/lib/ruby-prof/method_info.rb +26 -4
- data/lib/ruby-prof/minus.png +0 -0
- data/lib/ruby-prof/multi_printer.rb +56 -0
- data/lib/ruby-prof/plus.png +0 -0
- data/lib/ruby-prof/profile.rb +72 -0
- data/lib/ruby-prof/rack.rb +31 -0
- data/lib/ruby-prof/symbol_to_proc.rb +3 -1
- data/lib/ruby-prof/task.rb +20 -19
- data/lib/ruby-prof/test.rb +5 -3
- data/lib/ruby_prof.exp +0 -0
- data/lib/ruby_prof.ilk +0 -0
- data/lib/ruby_prof.lib +0 -0
- data/lib/ruby_prof.pdb +0 -0
- data/lib/ruby_prof.so +0 -0
- data/lib/unprof.rb +2 -0
- data/test/aggregate_test.rb +29 -14
- data/test/basic_test.rb +3 -251
- data/test/bug_test.rb +6 -0
- data/test/duplicate_names_test.rb +4 -4
- data/test/dynamic_method_test.rb +61 -0
- data/test/enumerable_test.rb +4 -4
- data/test/exceptions_test.rb +6 -5
- data/test/exclude_threads_test.rb +47 -47
- data/test/exec_test.rb +5 -5
- data/test/line_number_test.rb +16 -16
- data/test/measure_allocations_test.rb +25 -0
- data/test/measure_cpu_time_test.rb +212 -0
- data/test/measure_gc_runs_test.rb +29 -0
- data/test/measure_gc_time_test.rb +29 -0
- data/test/measure_memory_test.rb +36 -0
- data/test/measure_process_time_test.rb +205 -0
- data/test/measure_wall_time_test.rb +209 -0
- data/test/method_elimination_test.rb +74 -0
- data/test/module_test.rb +12 -21
- data/test/multi_printer_test.rb +81 -0
- data/test/no_method_class_test.rb +5 -3
- data/test/prime.rb +7 -10
- data/test/prime_test.rb +3 -3
- data/test/printers_test.rb +180 -54
- data/test/recursive_test.rb +34 -72
- data/test/singleton_test.rb +5 -4
- data/test/stack_printer_test.rb +73 -0
- data/test/stack_test.rb +7 -7
- data/test/start_stop_test.rb +23 -6
- data/test/test_helper.rb +81 -0
- data/test/test_suite.rb +35 -21
- data/test/thread_test.rb +40 -39
- data/test/unique_call_path_test.rb +6 -6
- metadata +106 -51
- data/ext/ruby_prof/measure_allocations.h +0 -58
- data/ext/ruby_prof/measure_cpu_time.h +0 -152
- data/ext/ruby_prof/measure_gc_runs.h +0 -76
- data/ext/ruby_prof/measure_gc_time.h +0 -57
- data/ext/ruby_prof/measure_memory.h +0 -101
- data/ext/ruby_prof/measure_process_time.h +0 -52
- data/ext/ruby_prof/measure_wall_time.h +0 -53
- data/ext/ruby_prof/mingw/Rakefile +0 -23
- data/ext/ruby_prof/mingw/build.rake +0 -38
- data/rails/environment/profile.rb +0 -24
- data/rails/example/example_test.rb +0 -9
- data/rails/profile_test_helper.rb +0 -21
- data/test/current_failures_windows +0 -8
- data/test/measurement_test.rb +0 -121
- data/test/ruby-prof-bin +0 -20
@@ -1,21 +0,0 @@
|
|
1
|
-
# Load profile environment
|
2
|
-
env = ENV["RAILS_ENV"] = "profile"
|
3
|
-
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
|
4
|
-
|
5
|
-
# Load Rails testing infrastructure
|
6
|
-
require 'test_help'
|
7
|
-
|
8
|
-
# Now we can load test_helper since we've already loaded the
|
9
|
-
# profile RAILS environment.
|
10
|
-
require File.expand_path(File.join(RAILS_ROOT, 'test', 'test_helper'))
|
11
|
-
|
12
|
-
# Reset the current environment back to profile
|
13
|
-
# since test_helper reset it to test
|
14
|
-
ENV["RAILS_ENV"] = env
|
15
|
-
|
16
|
-
# Now load ruby-prof and away we go
|
17
|
-
require 'ruby-prof'
|
18
|
-
|
19
|
-
# Setup output directory to Rails tmp directory
|
20
|
-
RubyProf::Test::PROFILE_OPTIONS[:output_dir] =
|
21
|
-
File.expand_path(File.join(RAILS_ROOT, 'tmp', 'profile'))
|
data/test/measurement_test.rb
DELETED
@@ -1,121 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'test/unit'
|
3
|
-
require 'ruby-prof'
|
4
|
-
|
5
|
-
class MeasurementTest < Test::Unit::TestCase
|
6
|
-
def setup
|
7
|
-
GC.enable_stats if GC.respond_to?(:enable_stats)
|
8
|
-
end
|
9
|
-
|
10
|
-
def teardown
|
11
|
-
GC.disable_stats if GC.respond_to?(:disable_stats)
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_process_time_mode
|
15
|
-
RubyProf::measure_mode = RubyProf::PROCESS_TIME
|
16
|
-
assert_equal(RubyProf::PROCESS_TIME, RubyProf::measure_mode)
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_process_time
|
20
|
-
t = RubyProf.measure_process_time
|
21
|
-
assert_kind_of(Float, t)
|
22
|
-
|
23
|
-
u = RubyProf.measure_process_time
|
24
|
-
assert(u >= t, [t, u].inspect)
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_wall_time_mode
|
28
|
-
RubyProf::measure_mode = RubyProf::WALL_TIME
|
29
|
-
assert_equal(RubyProf::WALL_TIME, RubyProf::measure_mode)
|
30
|
-
end
|
31
|
-
|
32
|
-
def test_wall_time
|
33
|
-
t = RubyProf.measure_wall_time
|
34
|
-
assert_kind_of Float, t
|
35
|
-
|
36
|
-
u = RubyProf.measure_wall_time
|
37
|
-
assert u >= t, [t, u].inspect
|
38
|
-
end
|
39
|
-
|
40
|
-
if RubyProf::CPU_TIME
|
41
|
-
def test_cpu_time_mode
|
42
|
-
RubyProf::measure_mode = RubyProf::CPU_TIME
|
43
|
-
assert_equal(RubyProf::CPU_TIME, RubyProf::measure_mode)
|
44
|
-
end
|
45
|
-
|
46
|
-
def test_cpu_time
|
47
|
-
RubyProf.cpu_frequency = 2.33e9
|
48
|
-
|
49
|
-
t = RubyProf.measure_cpu_time
|
50
|
-
assert_kind_of Float, t
|
51
|
-
|
52
|
-
u = RubyProf.measure_cpu_time
|
53
|
-
assert u > t, [t, u].inspect
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
if RubyProf::ALLOCATIONS
|
58
|
-
def test_allocations_mode
|
59
|
-
RubyProf::measure_mode = RubyProf::ALLOCATIONS
|
60
|
-
assert_equal(RubyProf::ALLOCATIONS, RubyProf::measure_mode)
|
61
|
-
end
|
62
|
-
|
63
|
-
def test_allocations
|
64
|
-
t = RubyProf.measure_allocations
|
65
|
-
assert_kind_of Integer, t
|
66
|
-
|
67
|
-
u = RubyProf.measure_allocations
|
68
|
-
assert u > t, [t, u].inspect
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
if RubyProf::MEMORY
|
73
|
-
def test_memory_mode
|
74
|
-
RubyProf::measure_mode = RubyProf::MEMORY
|
75
|
-
assert_equal(RubyProf::MEMORY, RubyProf::measure_mode)
|
76
|
-
end
|
77
|
-
|
78
|
-
def test_memory
|
79
|
-
t = RubyProf.measure_memory
|
80
|
-
assert_kind_of Integer, t
|
81
|
-
|
82
|
-
u = RubyProf.measure_memory
|
83
|
-
assert(u >= t, [t, u].inspect)
|
84
|
-
|
85
|
-
result = RubyProf.profile {Array.new}
|
86
|
-
total = result.threads.values.first.methods.inject(0) { |sum, m| sum + m.total_time }
|
87
|
-
|
88
|
-
assert(total > 0, 'Should measure more than zero kilobytes of memory usage')
|
89
|
-
assert_not_equal(0, total % 1, 'Should not truncate fractional kilobyte measurements')
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
if RubyProf::GC_RUNS
|
94
|
-
def test_gc_runs_mode
|
95
|
-
RubyProf::measure_mode = RubyProf::GC_RUNS
|
96
|
-
assert_equal(RubyProf::GC_RUNS, RubyProf::measure_mode)
|
97
|
-
end
|
98
|
-
|
99
|
-
def test_gc_runs
|
100
|
-
t = RubyProf.measure_gc_runs
|
101
|
-
assert_kind_of Integer, t
|
102
|
-
|
103
|
-
GC.start
|
104
|
-
|
105
|
-
u = RubyProf.measure_gc_runs
|
106
|
-
assert u > t, [t, u].inspect
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
if RubyProf::GC_TIME
|
111
|
-
def test_gc_time
|
112
|
-
t = RubyProf.measure_gc_time
|
113
|
-
assert_kind_of Integer, t
|
114
|
-
|
115
|
-
GC.start
|
116
|
-
|
117
|
-
u = RubyProf.measure_gc_time
|
118
|
-
assert u > t, [t, u].inspect
|
119
|
-
end
|
120
|
-
end
|
121
|
-
end
|
data/test/ruby-prof-bin
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
#!E:/installs/ruby191p376/bin/ruby.exe
|
2
|
-
#
|
3
|
-
# This file was generated by RubyGems.
|
4
|
-
#
|
5
|
-
# The application 'ruby-prof' is installed as part of a gem, and
|
6
|
-
# this file is here to facilitate running it.
|
7
|
-
#
|
8
|
-
|
9
|
-
require 'rubygems'
|
10
|
-
|
11
|
-
version = ">= 0"
|
12
|
-
|
13
|
-
if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
|
14
|
-
version = $1
|
15
|
-
ARGV.shift
|
16
|
-
end
|
17
|
-
|
18
|
-
#gem 'ruby-prof', version
|
19
|
-
$: << File.dirname(__FILE__) + '/../lib'
|
20
|
-
load File.dirname(__FILE__) + '/../bin/ruby-prof'
|