bleak_house 3.7.1 → 4.0

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 (87) hide show
  1. data.tar.gz.sig +0 -0
  2. data/CHANGELOG +2 -0
  3. data/Manifest +12 -66
  4. data/README +57 -20
  5. data/TODO +2 -2
  6. data/bin/bleak +1 -14
  7. data/bleak_house.gemspec +10 -16
  8. data/ext/{bleak_house/logger/build_ruby.rb → build_ruby.rb} +17 -7
  9. data/ext/build_snapshot.rb +4 -0
  10. data/ext/{bleak_house/logger/extconf.rb → extconf.rb} +1 -1
  11. data/ext/snapshot.c +157 -0
  12. data/ext/{bleak_house/logger/snapshot.h → snapshot.h} +2 -45
  13. data/lib/bleak_house.rb +5 -5
  14. data/lib/bleak_house/analyzer.rb +24 -2
  15. data/lib/bleak_house/hook.rb +25 -0
  16. data/ruby/bleak_house.patch +358 -0
  17. data/ruby/configure.patch +242 -0
  18. data/ruby/gc.patch +116 -0
  19. data/ruby/ruby-1.8.6-p114.tar.bz2 +0 -0
  20. data/ruby/valgrind.patch +136 -0
  21. data/test/benchmark/bench.rb +16 -0
  22. data/test/unit/test_bleak_house.rb +26 -27
  23. metadata +22 -86
  24. metadata.gz.sig +0 -0
  25. data/ext/bleak_house/logger/build_logger.rb +0 -3
  26. data/ext/bleak_house/logger/snapshot.c +0 -204
  27. data/init.rb +0 -3
  28. data/install.rb +0 -2
  29. data/lib/bleak_house/analyzer/analyzer.rb +0 -358
  30. data/lib/bleak_house/logger.rb +0 -2
  31. data/lib/bleak_house/logger/source.rb +0 -21
  32. data/lib/bleak_house/rails.rb +0 -6
  33. data/lib/bleak_house/rails/action_controller.rb +0 -17
  34. data/lib/bleak_house/rails/bleak_house.rb +0 -62
  35. data/lib/bleak_house/rails/dispatcher.rb +0 -36
  36. data/lib/bleak_house/support/core_extensions.rb +0 -61
  37. data/ruby/gc.c.patch +0 -27
  38. data/ruby/parse.y.patch +0 -16
  39. data/ruby/ruby-1.8.6-p110.tar.bz2 +0 -0
  40. data/test/integration/app/README +0 -203
  41. data/test/integration/app/Rakefile +0 -10
  42. data/test/integration/app/app/controllers/application.rb +0 -12
  43. data/test/integration/app/app/controllers/items_controller.rb +0 -6
  44. data/test/integration/app/app/helpers/application_helper.rb +0 -3
  45. data/test/integration/app/app/helpers/items_helper.rb +0 -2
  46. data/test/integration/app/app/views/items/index.rhtml +0 -2
  47. data/test/integration/app/config/boot.rb +0 -109
  48. data/test/integration/app/config/database.yml +0 -19
  49. data/test/integration/app/config/environment.rb +0 -15
  50. data/test/integration/app/config/environments/development.rb +0 -18
  51. data/test/integration/app/config/environments/production.rb +0 -19
  52. data/test/integration/app/config/environments/test.rb +0 -22
  53. data/test/integration/app/config/initializers/inflections.rb +0 -10
  54. data/test/integration/app/config/initializers/mime_types.rb +0 -5
  55. data/test/integration/app/config/routes.rb +0 -35
  56. data/test/integration/app/doc/README_FOR_APP +0 -2
  57. data/test/integration/app/public/404.html +0 -30
  58. data/test/integration/app/public/422.html +0 -30
  59. data/test/integration/app/public/500.html +0 -30
  60. data/test/integration/app/public/dispatch.cgi +0 -10
  61. data/test/integration/app/public/dispatch.fcgi +0 -24
  62. data/test/integration/app/public/dispatch.rb +0 -10
  63. data/test/integration/app/public/favicon.ico +0 -0
  64. data/test/integration/app/public/images/rails.png +0 -0
  65. data/test/integration/app/public/javascripts/application.js +0 -2
  66. data/test/integration/app/public/javascripts/controls.js +0 -963
  67. data/test/integration/app/public/javascripts/dragdrop.js +0 -972
  68. data/test/integration/app/public/javascripts/effects.js +0 -1120
  69. data/test/integration/app/public/javascripts/prototype.js +0 -4225
  70. data/test/integration/app/public/robots.txt +0 -5
  71. data/test/integration/app/script/about +0 -3
  72. data/test/integration/app/script/console +0 -3
  73. data/test/integration/app/script/destroy +0 -3
  74. data/test/integration/app/script/generate +0 -3
  75. data/test/integration/app/script/performance/benchmarker +0 -3
  76. data/test/integration/app/script/performance/profiler +0 -3
  77. data/test/integration/app/script/performance/request +0 -3
  78. data/test/integration/app/script/plugin +0 -3
  79. data/test/integration/app/script/process/inspector +0 -3
  80. data/test/integration/app/script/process/reaper +0 -3
  81. data/test/integration/app/script/process/spawner +0 -3
  82. data/test/integration/app/script/runner +0 -3
  83. data/test/integration/app/script/server +0 -3
  84. data/test/integration/app/test/functional/items_controller_test.rb +0 -8
  85. data/test/integration/app/test/test_helper.rb +0 -38
  86. data/test/integration/server_test.rb +0 -93
  87. data/test/misc/direct.rb +0 -13
@@ -1,5 +0,0 @@
1
- # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
- #
3
- # To ban all spiders from the entire site uncomment the next two lines:
4
- # User-Agent: *
5
- # Disallow: /
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../config/boot'
3
- require 'commands/about'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../config/boot'
3
- require 'commands/console'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../config/boot'
3
- require 'commands/destroy'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../config/boot'
3
- require 'commands/generate'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../../config/boot'
3
- require 'commands/performance/benchmarker'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../../config/boot'
3
- require 'commands/performance/profiler'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../../config/boot'
3
- require 'commands/performance/request'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../config/boot'
3
- require 'commands/plugin'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../../config/boot'
3
- require 'commands/process/inspector'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../../config/boot'
3
- require 'commands/process/reaper'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../../config/boot'
3
- require 'commands/process/spawner'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../config/boot'
3
- require 'commands/runner'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../config/boot'
3
- require 'commands/server'
@@ -1,8 +0,0 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
-
3
- class ItemsControllerTest < ActionController::TestCase
4
- # Replace this with your real tests.
5
- def test_truth
6
- assert true
7
- end
8
- end
@@ -1,38 +0,0 @@
1
- ENV["RAILS_ENV"] = "test"
2
- require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
3
- require 'test_help'
4
-
5
- class Test::Unit::TestCase
6
- # Transactional fixtures accelerate your tests by wrapping each test method
7
- # in a transaction that's rolled back on completion. This ensures that the
8
- # test database remains unchanged so your fixtures don't have to be reloaded
9
- # between every test method. Fewer database queries means faster tests.
10
- #
11
- # Read Mike Clark's excellent walkthrough at
12
- # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
13
- #
14
- # Every Active Record database supports transactions except MyISAM tables
15
- # in MySQL. Turn off transactional fixtures in this case; however, if you
16
- # don't care one way or the other, switching from MyISAM to InnoDB tables
17
- # is recommended.
18
- #
19
- # The only drawback to using transactional fixtures is when you actually
20
- # need to test transactions. Since your test is bracketed by a transaction,
21
- # any transactions started in your code will be automatically rolled back.
22
- self.use_transactional_fixtures = true
23
-
24
- # Instantiated fixtures are slow, but give you @david where otherwise you
25
- # would need people(:david). If you don't want to migrate your existing
26
- # test cases which use the @david style and don't mind the speed hit (each
27
- # instantiated fixtures translates to a database query per test method),
28
- # then set this back to true.
29
- self.use_instantiated_fixtures = false
30
-
31
- # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
32
- #
33
- # Note: You'll currently still have to declare fixtures explicitly in integration tests
34
- # -- they do not yet inherit this setting
35
- fixtures :all
36
-
37
- # Add more helper methods to be used by all tests here...
38
- end
@@ -1,93 +0,0 @@
1
-
2
- require "#{File.dirname(__FILE__)}/../test_helper"
3
-
4
- class ServerTest < Test::Unit::TestCase
5
-
6
- RAILS_ROOT = HERE + "/integration/app"
7
- PORT = 43039
8
- URL = "http://localhost:#{PORT}/"
9
- LOG = "#{HERE}/integration/app/log/production.log"
10
- system("touch #{LOG}")
11
-
12
- def test_server_start
13
- assert_match(/Ok/, browse("items"))
14
- end
15
-
16
- def test_too_few_frames
17
- browse("items")
18
- assert_match(/Not enough frames/, analyze)
19
- end
20
-
21
- def test_enough_frames
22
- 11.times do
23
- browse("items")
24
- end
25
-
26
- result = analyze
27
-
28
- # XXX Doesn't test the caching mechanism
29
-
30
- assert_match(/leaked per request \(9\)/, result)
31
- assert_match(/items\/index\/GET leaked/mi, result)
32
- assert_match(/Inspection samples/, result)
33
- assert_match(/core rails leaked/, result)
34
- assert_match(/Impact.*core rails/m, result)
35
- assert_match(/Impact.*items\/index\/GET/mi, result)
36
- end
37
-
38
- private
39
-
40
- # Mostly copied from Interlock's tests
41
-
42
- def browse(url = "")
43
- flag = false
44
- begin
45
- open(URL + url).read
46
- rescue Errno::ECONNREFUSED, OpenURI::HTTPError => e
47
- raise "#{e.to_s}: #{URL + url}" if flag
48
- flag = true
49
- sleep 3
50
- retry
51
- end
52
- end
53
-
54
- def analyze
55
- ENV['INITIAL_SKIP'] = "2"
56
- `#{HERE}/../bin/bleak #{HERE}/integration/app/log/bleak_house_production.dump`
57
- end
58
-
59
- def truncate
60
- Dir["#{RAILS_ROOT}/log/bleak_house*"].each { |f| File.delete f }
61
- system("> #{LOG}")
62
- end
63
-
64
- def log
65
- File.open(LOG, 'r') { |f| f.read }
66
- end
67
-
68
- def setup
69
- Process.fork do
70
- Dir.chdir(RAILS_ROOT) do
71
- ENV['RAILS_GEM_VERSION'] = ENV['MULTIRAILS_RAILS_VERSION']
72
- exec("RAILS_ENV=production SAMPLE_RATE=0.5 BLEAK_HOUSE=1 script/server -p #{PORT} &> #{LOG}")
73
- end
74
- end
75
-
76
- 50.times do |n|
77
- break if log =~ /available at 0.0.0.0:#{PORT}/
78
- sleep(0.2)
79
- raise "Server didn't start" if n == 49
80
- end
81
-
82
- truncate
83
- end
84
-
85
- def teardown
86
- # Process.kill(9, pid) doesn't work because Mongrel has double-forked itself away
87
- while (pids = `ps awx | grep #{PORT} | grep -v grep | awk '{print $1}'`.split("\n")).any?
88
- pids.each {|pid| system("kill #{pid}")}
89
- sleep(0.2)
90
- end
91
- end
92
-
93
- end
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby-bleak-house
2
-
3
- require 'rubygems'
4
- require 'bleak_house/c'
5
- $memlogger = BleakHouse::Logger.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)