Skip to content

Commit b41fa49

Browse files
committed
update rails 4
ensure you clear the tmp/cache folder on each bench (so results are correct, there is an incompat upgrade) add facter gem which will be used to collect hardware data from the bencher
1 parent 2c61828 commit b41fa49

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

Gemfile_rails4.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ GIT
3333

3434
GIT
3535
remote: git://github.com/rails/rails.git
36-
revision: e36692a7466011ab51393ac8ca6dfffcb9d79ec0
36+
revision: 78624ffedbf98c49743a60e00aa1351c9a48f54b
3737
branch: 4-0-stable
3838
specs:
3939
actionmailer (4.0.0)

config/environments/profile.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
config.handlebars.precompile = true
3838

3939
# this setting enable rack_cache so it caches various requests in redis
40-
# config.enable_rack_cache = true
40+
config.enable_rack_cache = false
4141

4242
# allows users to use mini profiler
4343
config.enable_mini_profiler = false

script/bench.rb

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@
22
require "csv"
33
require "yaml"
44

5-
@timings = {}
6-
75
def run(command)
86
system(command, out: $stdout, err: :out)
97
end
108

9+
begin
10+
require 'facter'
11+
rescue LoadError
12+
run "gem install facter"
13+
puts "just installed the facter gem, please re-run script"
14+
exit
15+
end
16+
17+
@timings = {}
18+
19+
1120
def measure(name)
1221
start = Time.now
1322
yield
@@ -98,6 +107,8 @@ def bench(path)
98107
end
99108

100109
begin
110+
# critical cause cache may be incompatible or something
111+
`rm -fr tmp/cache`
101112
pid = spawn("bundle exec thin start -p #{@port}")
102113

103114
while port_available? @port
@@ -119,6 +130,8 @@ def bench(path)
119130
"rails4?" => ENV["RAILS4"] == "1"
120131
}.to_yaml)
121132

133+
# TODO include Facter.to_hash ... for all facts
134+
122135
ensure
123136
Process.kill "KILL", pid
124137
end

0 commit comments

Comments
 (0)