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
This commit is contained in:
Sam 2013-08-29 21:23:00 +10:00
parent 2c61828668
commit b41fa4988a
3 changed files with 17 additions and 4 deletions

View file

@ -33,7 +33,7 @@ GIT
GIT GIT
remote: git://github.com/rails/rails.git remote: git://github.com/rails/rails.git
revision: e36692a7466011ab51393ac8ca6dfffcb9d79ec0 revision: 78624ffedbf98c49743a60e00aa1351c9a48f54b
branch: 4-0-stable branch: 4-0-stable
specs: specs:
actionmailer (4.0.0) actionmailer (4.0.0)

View file

@ -37,7 +37,7 @@ Discourse::Application.configure do
config.handlebars.precompile = true config.handlebars.precompile = true
# this setting enable rack_cache so it caches various requests in redis # this setting enable rack_cache so it caches various requests in redis
# config.enable_rack_cache = true config.enable_rack_cache = false
# allows users to use mini profiler # allows users to use mini profiler
config.enable_mini_profiler = false config.enable_mini_profiler = false

View file

@ -2,12 +2,21 @@ require "socket"
require "csv" require "csv"
require "yaml" require "yaml"
@timings = {}
def run(command) def run(command)
system(command, out: $stdout, err: :out) system(command, out: $stdout, err: :out)
end end
begin
require 'facter'
rescue LoadError
run "gem install facter"
puts "just installed the facter gem, please re-run script"
exit
end
@timings = {}
def measure(name) def measure(name)
start = Time.now start = Time.now
yield yield
@ -98,6 +107,8 @@ def bench(path)
end end
begin begin
# critical cause cache may be incompatible or something
`rm -fr tmp/cache`
pid = spawn("bundle exec thin start -p #{@port}") pid = spawn("bundle exec thin start -p #{@port}")
while port_available? @port while port_available? @port
@ -119,6 +130,8 @@ begin
"rails4?" => ENV["RAILS4"] == "1" "rails4?" => ENV["RAILS4"] == "1"
}.to_yaml) }.to_yaml)
# TODO include Facter.to_hash ... for all facts
ensure ensure
Process.kill "KILL", pid Process.kill "KILL", pid
end end