bleak_house 7 → 7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +23 -13
- data/{LICENSE_AFL → LICENSE} +0 -0
- data/{lib/bleak_house/LICENSE_BSD → LICENSE_BSD} +0 -0
- data/Manifest +21 -20
- data/README +45 -27
- data/Rakefile +14 -33
- data/lib/bleak_house/action_controller.rb +1 -0
- data/lib/bleak_house/analyze.rb +25 -16
- data/lib/bleak_house/bleak_house.rb +23 -8
- data/lib/bleak_house/c.rb +30 -1
- data/lib/bleak_house/dispatcher.rb +3 -2
- data/test/misc/direct.rb +13 -0
- data/test/unit/test_bleak_house.rb +0 -15
- metadata +59 -32
data/CHANGELOG
CHANGED
@@ -1,15 +1,25 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
2
|
+
v7.1. RDoc documentation; use new Echoe setup; fix for namespaced controllers.
|
3
|
+
|
4
|
+
v7. Detect if core keys are present or not; fixes for analyzing non-Rails apps.
|
5
|
+
|
6
|
+
v6. Log heap usage; remove pure-Ruby profiler.
|
7
|
+
|
8
|
+
v5.3. Subtract Rails core counts from action counts and join paired frames.
|
9
|
+
|
10
|
+
v5.2. Change smoothing algorithm to be more intuitive and so mem usage is correct.
|
11
|
+
|
12
|
+
v5.1. Close file properly.
|
13
|
+
|
14
|
+
v5. C instrumentation with YAML output.
|
15
|
+
|
16
|
+
v4. Log memory usage on *nix.
|
17
|
+
|
18
|
+
v3.1. Fix nil directory traversal error on Windows.
|
19
|
+
|
20
|
+
v3. Gem version
|
21
|
+
|
22
|
+
v2. Dumped Rublique; replaced with a lightweight non-delta marshalling version.
|
23
|
+
|
24
|
+
v1. First version
|
15
25
|
|
data/{LICENSE_AFL → LICENSE}
RENAMED
File without changes
|
File without changes
|
data/Manifest
CHANGED
@@ -1,20 +1,21 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
1
|
+
test/unit/test_bleak_house.rb
|
2
|
+
test/misc/direct.rb
|
3
|
+
tasks/bleak_house_tasks.rake
|
4
|
+
patches/gc.c.patch
|
5
|
+
lib/bleak_house.rb
|
6
|
+
lib/bleak_house/support_methods.rb
|
7
|
+
lib/bleak_house/rake_task_redefine_task.rb
|
8
|
+
lib/bleak_house/gruff_hacks.rb
|
9
|
+
lib/bleak_house/dispatcher.rb
|
10
|
+
lib/bleak_house/c.rb
|
11
|
+
lib/bleak_house/bleak_house.rb
|
12
|
+
lib/bleak_house/analyze.rb
|
13
|
+
lib/bleak_house/action_controller.rb
|
14
|
+
install.rb
|
15
|
+
init.rb
|
16
|
+
Rakefile
|
17
|
+
README
|
18
|
+
Manifest
|
19
|
+
LICENSE_BSD
|
20
|
+
LICENSE
|
21
|
+
CHANGELOG
|
data/README
CHANGED
@@ -1,50 +1,68 @@
|
|
1
1
|
|
2
2
|
BleakHouse
|
3
3
|
|
4
|
-
|
4
|
+
A library and Rails plugin for finding memory leaks.
|
5
5
|
|
6
|
-
|
6
|
+
== License
|
7
7
|
|
8
|
-
|
8
|
+
Copyright 2007 Cloudburst, LLC. See the included LICENSE file. Portions copyright 2006 Eric Hodel and used with permission. See included the LICENSE_BSD file.
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
== Features
|
11
|
+
|
12
|
+
* leak-proof C instrumentation
|
13
|
+
* logs object counts, real and virtual memory usage, and filled/free heap slots
|
14
|
+
* easy Rails integration
|
15
|
+
* automatic generation of nested object charts
|
16
|
+
|
17
|
+
== Requirements
|
18
|
+
|
19
|
+
* A unix-like operating system.
|
20
|
+
* Ruby 1.8.6
|
21
|
+
|
22
|
+
= Usage
|
23
|
+
|
24
|
+
== Installation
|
25
|
+
|
26
|
+
First, install the plugin in your Rails app:
|
27
|
+
./script/plugin install svn://rubyforge.org/var/svn/fauna/bleak_house/trunk
|
28
|
+
|
29
|
+
You need to compile the BleakHouse patched Ruby build. In the plugin directory, run:
|
12
30
|
rake ruby:build
|
31
|
+
|
32
|
+
This gives you a Ruby binary named <tt>ruby-bleak-house</tt> alongside your regular binary.
|
33
|
+
|
34
|
+
(BleakHouse is also available as a gem: <tt>sudo gem install bleak_house</tt>. If you use the gem, <tt>require 'bleak_house'</tt> in <tt>config/environment.rb</tt>. You will also have to manually install the <tt>bleak_house:analyze</tt> Rake task.)
|
13
35
|
|
14
|
-
|
36
|
+
== Profiling a Rails app
|
15
37
|
|
16
|
-
To profile your application:
|
38
|
+
To profile your application (ideally, in production mode, on an actual application server):
|
17
39
|
RAILS_ENV=production BLEAK_HOUSE=true ruby-bleak-house ./script/server
|
18
40
|
|
19
|
-
Browse around manually, thrash your entire app with a script,
|
20
|
-
target troublesome controllers/actions, etc.
|
41
|
+
Browse around manually, thrash your entire app with a script, target troublesome controllers/actions, etc.
|
21
42
|
|
22
43
|
Then, to analyze:
|
23
|
-
RAILS_ENV=production
|
44
|
+
RAILS_ENV=production rake bleak_house:analyze
|
45
|
+
|
46
|
+
And then look in <tt>log/bleak_house/</tt>.
|
47
|
+
|
48
|
+
= Extras
|
24
49
|
|
25
|
-
|
50
|
+
== Options
|
26
51
|
|
27
|
-
|
52
|
+
You also can set the SMOOTHNESS environment variable if you want. The SMOOTHNESS setting just averages frames together. This is not a rolling average: 10 frames become 5 at <tt>SMOOTHNESS=2</tt>.
|
28
53
|
|
29
|
-
|
30
|
-
it means you installed the patched binary, but tried to profile the
|
31
|
-
server with the regular binary.
|
54
|
+
== Using BleakHouse outside of Rails
|
32
55
|
|
33
|
-
|
34
|
-
alongside a different verson of Ruby. You could try to patch your local
|
35
|
-
version of Ruby instead, or you could just upgrade to 1.8.6, which has
|
36
|
-
a good trackrecord of stability anyway.
|
56
|
+
If you want finer snapshots than every action, or want to use the plugin outside of Rails, see the BleakHouse::CLogger class.
|
37
57
|
|
38
|
-
|
58
|
+
== Troubleshooting
|
39
59
|
|
40
|
-
|
60
|
+
If you see the error <tt>Symbol not found: _rb_gc_heaps_used</tt>, it means you installed the patched binary, but tried to profile the server with the regular binary.
|
41
61
|
|
42
|
-
|
62
|
+
You may get library require errors if you install <tt>ruby-bleak-house</tt> 1.8.6 alongside a different verson of Ruby. You could try to patch your local version of Ruby instead, or you could just upgrade to 1.8.6, which has a good trackrecord of stability.
|
43
63
|
|
44
|
-
|
45
|
-
file.
|
64
|
+
== Further resources
|
46
65
|
|
47
|
-
|
48
|
-
|
49
|
-
file).
|
66
|
+
* http://blog.evanweaver.com/pages/code#bleak_house
|
67
|
+
* http://rubyforge.org/forum/forum.php?forum_id=13983
|
50
68
|
|
data/Rakefile
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
require 'rubygems'
|
2
3
|
require 'rake'
|
3
4
|
require 'lib/bleak_house/rake_task_redefine_task'
|
@@ -5,48 +6,28 @@ require 'lib/bleak_house/rake_task_redefine_task'
|
|
5
6
|
DIR = File.dirname(__FILE__)
|
6
7
|
|
7
8
|
begin
|
8
|
-
require 'rake/clean'
|
9
|
-
gem 'echoe', '>= 1.2'
|
10
9
|
require 'echoe'
|
11
|
-
require 'fileutils'
|
12
|
-
include FileUtils
|
13
|
-
|
14
|
-
CLEAN.include ['**/.*.sw?', '*.gem', '.config']
|
15
|
-
VERS = `cat CHANGELOG`[/^([\d\.]+)\. /, 1]
|
16
10
|
|
17
11
|
taskmsg = File.open(DIR + "/tasks/bleak_house_tasks.rake").readlines
|
18
|
-
taskmsg = taskmsg[0..3] + [taskmsg[9][2..-1]] + taskmsg[12..-1]
|
12
|
+
taskmsg = taskmsg[0..3] + [taskmsg[9][2..-1]] + taskmsg[12..-1] # XXX weak
|
19
13
|
|
20
|
-
echoe = Echoe.new("bleak_house"
|
14
|
+
echoe = Echoe.new("bleak_house") do |p|
|
21
15
|
p.author = "Evan Weaver"
|
22
|
-
p.
|
23
|
-
p.
|
24
|
-
p.
|
25
|
-
p.
|
26
|
-
p.
|
27
|
-
p.
|
28
|
-
p.
|
29
|
-
|
30
|
-
p.need_tar_gz = true
|
31
|
-
p.test_globs = ["*_test.rb"]
|
32
|
-
p.extra_deps = ["RubyInline"]
|
33
|
-
p.clean_globs = CLEAN
|
34
|
-
p.spec_extras = {:post_install_message =>
|
35
|
-
"
|
36
|
-
Thanks for installing Bleak House #{VERS}.
|
16
|
+
p.project = "fauna"
|
17
|
+
p.summary = "A Rails plugin for finding memory leaks."
|
18
|
+
p.url = "http://blog.evanweaver.com/pages/code#bleak_house"
|
19
|
+
p.docs_host = 'blog.evanweaver.com:~/www/snax/public/files/doc/'
|
20
|
+
p.rdoc_pattern = /^(bin|tasks)|analyze|bleak_house\/bleak_house\.rb|c\.rb|^README|^CHANGELOG|^TODO|^LICENSE$/
|
21
|
+
p.dependencies = ['gruff =0.2.8', 'rmagick', 'activesupport', 'RubyInline']
|
22
|
+
p.install_message = "
|
23
|
+
Thanks for installing BleakHouse.
|
37
24
|
|
38
25
|
For each Rails app you want to profile, you will need to add the
|
39
|
-
following rake task in RAILS_ROOT/lib/tasks/bleak_house_tasks.rake
|
40
|
-
|
41
|
-
" + taskmsg.join(" ") + "\n"}
|
26
|
+
following rake task in RAILS_ROOT/lib/tasks/bleak_house_tasks.rake:
|
27
|
+
" + taskmsg.join(" ") + "\n"
|
42
28
|
end
|
43
29
|
|
44
|
-
rescue LoadError
|
45
|
-
puts "You are missing a dependency required for meta-operations on this gem."
|
46
|
-
puts "#{boom.to_s.capitalize}."
|
47
|
-
|
48
|
-
desc 'Run tests.'
|
49
|
-
task :default => :test
|
30
|
+
rescue LoadError
|
50
31
|
end
|
51
32
|
|
52
33
|
desc 'Run tests.'
|
data/lib/bleak_house/analyze.rb
CHANGED
@@ -17,6 +17,7 @@ Gruff::Base::NEGATIVE_TOP_MARGIN = 30
|
|
17
17
|
Gruff::Base::MAX_LEGENDS = 28
|
18
18
|
|
19
19
|
class BleakHouse
|
20
|
+
# Draws the BleakHouse graphs.
|
20
21
|
class Analyze
|
21
22
|
|
22
23
|
SMOOTHNESS = ENV['SMOOTHNESS'].to_i.zero? ? 1 : ENV['SMOOTHNESS'].to_i
|
@@ -24,24 +25,28 @@ class BleakHouse
|
|
24
25
|
HEAP_KEY = "heap usage"
|
25
26
|
CORE_KEY = "core rails"
|
26
27
|
|
28
|
+
# Sets up a single graph.
|
27
29
|
def initialize(data, increments, name)
|
28
30
|
@data = data
|
29
31
|
@increments = increments
|
30
32
|
@name = name
|
31
33
|
end
|
32
34
|
|
33
|
-
def d
|
35
|
+
def d #:nodoc:
|
34
36
|
self.class.d
|
35
37
|
end
|
36
38
|
|
37
|
-
|
39
|
+
# Draw <tt>self</tt>. Use some special attributes added to Gruff. Requires the overrides in <tt>gruff_hacks.rb</tt>.
|
40
|
+
def draw #:nodoc:
|
38
41
|
g = Gruff::Line.new("1024x768")
|
39
42
|
g.title = @name
|
40
43
|
g.x_axis_label = "time"
|
41
44
|
g.legend_font_size = g.legend_box_size = 14
|
42
45
|
g.title_font_size = 24
|
43
46
|
g.marker_font_size = 14
|
44
|
-
|
47
|
+
|
48
|
+
# mangle some key names.
|
49
|
+
# XXX unreadable
|
45
50
|
@data.map do |key, values|
|
46
51
|
["#{(key.to_s.empty? ? '[Unknown]' : key).gsub(/.*::/, '')} (#{ if
|
47
52
|
[MEM_KEY, HEAP_KEY].include?(key)
|
@@ -69,7 +74,8 @@ class BleakHouse
|
|
69
74
|
g.write(@name.to_filename + ".png")
|
70
75
|
end
|
71
76
|
|
72
|
-
|
77
|
+
# Takes subkeys that match the <tt>selector</tt> regex and adds each subkey's count to the key named by the first group match in the <tt>namer</tt> regex for that subkey.
|
78
|
+
def self.aggregate(data, selector = //, namer = //) #:nodoc:
|
73
79
|
aggregate_data = {}
|
74
80
|
increments = []
|
75
81
|
data.each_with_index do |frameset, index|
|
@@ -88,24 +94,26 @@ class BleakHouse
|
|
88
94
|
end
|
89
95
|
[aggregate_data, increments]
|
90
96
|
end
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
97
|
+
|
98
|
+
# Generates a chart for each tag (by subtag) and subtag (by object type). Output is written to <tt>bleak_house/</tt> in the same folder as the passed <tt>logfile</tt> attribute.
|
99
|
+
def self.build_all(logfile)
|
100
|
+
unless File.exists? logfile
|
101
|
+
puts "No data file found: #{logfile}"
|
95
102
|
exit
|
96
103
|
end
|
97
104
|
puts "parsing data"
|
98
|
-
data = YAML.load_file(
|
105
|
+
data = YAML.load_file(logfile)
|
99
106
|
|
100
|
-
rootdir = File.dirname(
|
107
|
+
rootdir = File.dirname(logfile) + "/bleak_house/"
|
101
108
|
FileUtils.rm_r(rootdir) rescue nil
|
102
109
|
Dir.mkdir(rootdir)
|
103
110
|
Dir.chdir(rootdir) do
|
104
|
-
|
105
|
-
labels = [
|
106
|
-
|
111
|
+
|
112
|
+
labels = []
|
113
|
+
|
114
|
+
# autodetect need for Rails snapshot conflation
|
107
115
|
if data.first.last.keys.first =~ /^#{CORE_KEY}::::/
|
108
|
-
# subtract core counts from action
|
116
|
+
# Rails snapshots double-count objects that start in the core and persist through the action (which is most core objects), so we need to the subtract core counts from action counts
|
109
117
|
data = data[0..(-1 - data.size % 2)]
|
110
118
|
data = data.in_groups_of(2).map do |frames|
|
111
119
|
core, action = frames.first, frames.last
|
@@ -115,12 +123,13 @@ class BleakHouse
|
|
115
123
|
[action.time, core.data.merge(action.data)]
|
116
124
|
end
|
117
125
|
puts " conflated core rails snapshots with their actions"
|
126
|
+
labels = ["controller", "action"]
|
118
127
|
else
|
119
128
|
puts " assuming custom snapshotting"
|
120
129
|
labels = ["tag", "subtag"]
|
121
130
|
end
|
122
131
|
|
123
|
-
# smooth
|
132
|
+
# smooth frames (just an average)
|
124
133
|
data = data[0..(-1 - data.size % SMOOTHNESS)]
|
125
134
|
data = data.in_groups_of(SMOOTHNESS).map do |frames|
|
126
135
|
timestamp = frames.map(&:time).sum / SMOOTHNESS
|
@@ -179,7 +188,7 @@ class BleakHouse
|
|
179
188
|
end
|
180
189
|
end
|
181
190
|
|
182
|
-
def self.d
|
191
|
+
def self.d #:nodoc:
|
183
192
|
require 'ruby-debug'; Debugger.start; debugger
|
184
193
|
end
|
185
194
|
|
@@ -1,20 +1,35 @@
|
|
1
1
|
|
2
2
|
class BleakHouse
|
3
3
|
cattr_accessor :last_request_name
|
4
|
+
|
5
|
+
# Avoid making four more strings on each request.
|
6
|
+
CONTROLLER_KEY = 'controller'
|
7
|
+
ACTION_KEY = 'action'
|
8
|
+
GSUB_SEARCH = '/'
|
9
|
+
GSUB_REPLACEMENT = '__'
|
4
10
|
|
11
|
+
# Sets the request name on the BleakHouse object to match this Rails request. Called from <tt>ActionController::Base.process</tt>. Assign to <tt>last_request_name</tt> yourself if you are not using BleakHouse within Rails.
|
5
12
|
def self.set_request_name request, other = nil
|
6
|
-
self.last_request_name = "#{
|
13
|
+
self.last_request_name = "#{
|
14
|
+
request.parameters[CONTROLLER_KEY].gsub(GSUB_SEARCH, GSUB_REPLACEMENT) # mangle namespaced controller names
|
15
|
+
}/#{
|
16
|
+
request.parameters[ACTION_KEY]
|
17
|
+
}/#{
|
18
|
+
request.request_method
|
19
|
+
}#{
|
20
|
+
other
|
21
|
+
}"
|
7
22
|
end
|
8
23
|
|
9
|
-
def self.debug s
|
10
|
-
s = "#{name.underscore}: #{s}"
|
11
|
-
|
24
|
+
def self.debug s #:nodoc:
|
25
|
+
s = "** #{name.underscore}: #{s}"
|
26
|
+
RAILS_DEFAULT_LOGGER.debug s if RAILS_DEFAULT_LOGGER
|
12
27
|
end
|
13
28
|
|
14
|
-
def self.warn s
|
15
|
-
s = "#{name.underscore}: #{s}"
|
16
|
-
if
|
17
|
-
|
29
|
+
def self.warn s #:nodoc:
|
30
|
+
s = "** #{name.underscore}: #{s}"
|
31
|
+
if RAILS_DEFAULT_LOGGER
|
32
|
+
RAILS_DEFAULT_LOGGER.warn s
|
18
33
|
else
|
19
34
|
$stderr.puts s
|
20
35
|
end
|
data/lib/bleak_house/c.rb
CHANGED
@@ -3,11 +3,36 @@ require 'rubygems'
|
|
3
3
|
require 'inline'
|
4
4
|
|
5
5
|
class BleakHouse
|
6
|
+
|
7
|
+
=begin rdoc
|
8
|
+
This class performs the actual object logging of BleakHouse. To use it directly, you need to make calls to BleakHouse::CLogger#snapshot.
|
9
|
+
|
10
|
+
== Example
|
11
|
+
|
12
|
+
At the start of your app, put:
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bleak_house/c'
|
15
|
+
$memlogger = BleakHouse::CLogger.new
|
16
|
+
File.delete($logfile = "/path/to/logfile") rescue nil
|
17
|
+
|
18
|
+
(This assumes you are using the gem version.)
|
19
|
+
|
20
|
+
Now, at the points of interest, put:
|
21
|
+
$memlogger.snapshot($logfile, "tag/subtag", false)
|
22
|
+
|
23
|
+
Run your app. Once you are done, analyze your data:
|
24
|
+
ruby -r rubygems -e 'require "bleak_house/analyze"; BleakHouse::Analyze.build_all("/path/to/logfile")'
|
25
|
+
|
26
|
+
You will get a <tt>bleak_house/</tt> folder in the same folder as your logfile.
|
27
|
+
|
28
|
+
=end
|
29
|
+
|
6
30
|
class CLogger
|
7
31
|
|
8
32
|
MAX_UNIQ_TAGS = 1536 # per frame
|
9
33
|
MAX_TAG_LENGTH = 192 # tag plus fully namespaced classname
|
10
34
|
|
35
|
+
# Returns an array of the running process's real and virtual memory usage, in kilobytes.
|
11
36
|
def mem_usage
|
12
37
|
a = `ps -o vsz,rss -p #{Process.pid}`.split(/\s+/)[-2..-1].map{|el| el.to_i}
|
13
38
|
[a.first - a.last, a.last]
|
@@ -99,7 +124,11 @@ class BleakHouse
|
|
99
124
|
"T_SCOPE",
|
100
125
|
"T_NODE"]
|
101
126
|
|
102
|
-
# writes a frame to
|
127
|
+
# Counts the live objects on the heap and writes a single tagged YAML frame to the logfile. Set <tt>specials = true</tt> if you also want to count AST nodes and var scopes; otherwise, use <tt>false</tt>.
|
128
|
+
def snapshot(logfile, tag, specials)
|
129
|
+
# RDoc stub
|
130
|
+
end
|
131
|
+
|
103
132
|
builder.c <<-EOC
|
104
133
|
static void
|
105
134
|
VALUE snapshot(VALUE logfile, VALUE tag, VALUE _specials) {
|
@@ -1,8 +1,8 @@
|
|
1
1
|
|
2
|
-
#
|
3
|
-
|
2
|
+
# Override Dispatcher#prepare and Dispatcher#reset_after_dispatch so that each request makes before-and-after usage snapshots.
|
4
3
|
class Dispatcher
|
5
4
|
class << self
|
5
|
+
|
6
6
|
def prepare_application_with_bleak_house
|
7
7
|
prepare_application_without_bleak_house
|
8
8
|
BleakHouse::MEMLOGGER.snapshot(BleakHouse::LOGFILE, 'core rails', BleakHouse::WITH_SPECIALS)
|
@@ -14,5 +14,6 @@ class Dispatcher
|
|
14
14
|
reset_after_dispatch_without_bleak_house
|
15
15
|
end
|
16
16
|
alias_method_chain :reset_after_dispatch, :bleak_house
|
17
|
+
|
17
18
|
end
|
18
19
|
end
|
data/test/misc/direct.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
#!/usr/bin/env ruby-bleak-house
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bleak_house/c'
|
5
|
+
$memlogger = BleakHouse::CLogger.new
|
6
|
+
File.delete($logfile = "/tmp/log") rescue nil
|
7
|
+
|
8
|
+
puts 0
|
9
|
+
$memlogger.snapshot($logfile, "file", true)
|
10
|
+
puts 1
|
11
|
+
$memlogger.snapshot($logfile, "file/one", true)
|
12
|
+
puts 2
|
13
|
+
$memlogger.snapshot($logfile, "file/two", true)
|
@@ -6,9 +6,7 @@ require 'test/unit'
|
|
6
6
|
require 'yaml'
|
7
7
|
|
8
8
|
class BleakHouseTest < Test::Unit::TestCase
|
9
|
-
require "#{DIR}lib/bleak_house/mem_logger"
|
10
9
|
require "#{DIR}lib/bleak_house/c"
|
11
|
-
require "#{DIR}lib/bleak_house/ruby"
|
12
10
|
|
13
11
|
SNAPSHOT_FILE = "/tmp/bleak_house"
|
14
12
|
SNAPS = {:c => SNAPSHOT_FILE + ".c.yaml",
|
@@ -17,19 +15,6 @@ class BleakHouseTest < Test::Unit::TestCase
|
|
17
15
|
def setup
|
18
16
|
end
|
19
17
|
|
20
|
-
def test_mem_inspect
|
21
|
-
assert `ruby-bleak-house -rrubygems -e "require 'mem_inspect'; puts 'ok'"` == "ok\n"
|
22
|
-
end
|
23
|
-
|
24
|
-
def test_ruby_snapshot
|
25
|
-
File.delete SNAPS[:ruby] rescue nil
|
26
|
-
::BleakHouse::RubyLogger.new.snapshot(SNAPS[:ruby], "ruby_test", true)
|
27
|
-
assert File.exist?(SNAPS[:ruby])
|
28
|
-
assert_nothing_raised do
|
29
|
-
assert YAML.load_file(SNAPS[:ruby]).is_a?(Array)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
18
|
def test_c_snapshot
|
34
19
|
File.delete SNAPS[:c] rescue nil
|
35
20
|
::BleakHouse::CLogger.new.snapshot(SNAPS[:c], "c_test", true)
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.
|
2
|
+
rubygems_version: 0.9.4
|
3
3
|
specification_version: 1
|
4
4
|
name: bleak_house
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: "7"
|
7
|
-
date: 2007-
|
8
|
-
summary:
|
6
|
+
version: "7.1"
|
7
|
+
date: 2007-08-06 00:00:00 -04:00
|
8
|
+
summary: A Rails plugin for finding memory leaks.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
|
-
email:
|
12
|
-
homepage: http://blog.evanweaver.com
|
11
|
+
email: ""
|
12
|
+
homepage: http://blog.evanweaver.com/pages/code#bleak_house
|
13
13
|
rubyforge_project: fauna
|
14
|
-
description:
|
14
|
+
description: A Rails plugin for finding memory leaks.
|
15
15
|
autorequire:
|
16
16
|
default_executable:
|
17
17
|
bindir: bin
|
@@ -27,11 +27,10 @@ signing_key:
|
|
27
27
|
cert_chain:
|
28
28
|
post_install_message: |+
|
29
29
|
|
30
|
-
Thanks for installing
|
30
|
+
Thanks for installing BleakHouse.
|
31
31
|
|
32
32
|
For each Rails app you want to profile, you will need to add the
|
33
|
-
following rake task in RAILS_ROOT/lib/tasks/bleak_house_tasks.rake
|
34
|
-
to be able to run the analyzer:
|
33
|
+
following rake task in RAILS_ROOT/lib/tasks/bleak_house_tasks.rake:
|
35
34
|
|
36
35
|
namespace :bleak_house do
|
37
36
|
desc 'Analyze and chart all data'
|
@@ -45,28 +44,29 @@ post_install_message: |+
|
|
45
44
|
authors:
|
46
45
|
- Evan Weaver
|
47
46
|
files:
|
48
|
-
-
|
49
|
-
-
|
50
|
-
-
|
51
|
-
-
|
52
|
-
-
|
53
|
-
-
|
54
|
-
-
|
55
|
-
-
|
56
|
-
-
|
57
|
-
-
|
58
|
-
-
|
59
|
-
-
|
60
|
-
-
|
61
|
-
-
|
62
|
-
-
|
63
|
-
-
|
64
|
-
-
|
65
|
-
-
|
66
|
-
-
|
67
|
-
-
|
68
|
-
|
69
|
-
|
47
|
+
- test/unit/test_bleak_house.rb
|
48
|
+
- test/misc/direct.rb
|
49
|
+
- tasks/bleak_house_tasks.rake
|
50
|
+
- patches/gc.c.patch
|
51
|
+
- lib/bleak_house.rb
|
52
|
+
- lib/bleak_house/support_methods.rb
|
53
|
+
- lib/bleak_house/rake_task_redefine_task.rb
|
54
|
+
- lib/bleak_house/gruff_hacks.rb
|
55
|
+
- lib/bleak_house/dispatcher.rb
|
56
|
+
- lib/bleak_house/c.rb
|
57
|
+
- lib/bleak_house/bleak_house.rb
|
58
|
+
- lib/bleak_house/analyze.rb
|
59
|
+
- lib/bleak_house/action_controller.rb
|
60
|
+
- install.rb
|
61
|
+
- init.rb
|
62
|
+
- Rakefile
|
63
|
+
- README
|
64
|
+
- Manifest
|
65
|
+
- LICENSE_BSD
|
66
|
+
- LICENSE
|
67
|
+
- CHANGELOG
|
68
|
+
test_files:
|
69
|
+
- test/unit/test_bleak_house.rb
|
70
70
|
rdoc_options: []
|
71
71
|
|
72
72
|
extra_rdoc_files: []
|
@@ -78,6 +78,33 @@ extensions: []
|
|
78
78
|
requirements: []
|
79
79
|
|
80
80
|
dependencies:
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: gruff
|
83
|
+
version_requirement:
|
84
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 0.2.8
|
89
|
+
version:
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
name: rmagick
|
92
|
+
version_requirement:
|
93
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: 0.0.0
|
98
|
+
version:
|
99
|
+
- !ruby/object:Gem::Dependency
|
100
|
+
name: activesupport
|
101
|
+
version_requirement:
|
102
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ">"
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: 0.0.0
|
107
|
+
version:
|
81
108
|
- !ruby/object:Gem::Dependency
|
82
109
|
name: RubyInline
|
83
110
|
version_requirement:
|