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

@ -2,12 +2,21 @@ require "socket"
require "csv"
require "yaml"
@timings = {}
def run(command)
system(command, out: $stdout, err: :out)
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)
start = Time.now
yield
@ -98,6 +107,8 @@ def bench(path)
end
begin
# critical cause cache may be incompatible or something
`rm -fr tmp/cache`
pid = spawn("bundle exec thin start -p #{@port}")
while port_available? @port
@ -119,6 +130,8 @@ begin
"rails4?" => ENV["RAILS4"] == "1"
}.to_yaml)
# TODO include Facter.to_hash ... for all facts
ensure
Process.kill "KILL", pid
end