lak (owner)

Revisions

gist: 141185 Download_button fork
public
Public Clone URL: git://gist.github.com/141185.git
rails_benchmarking.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
class RailsBenchmarking
    BRANCHES = %w{rails/new rails/normal rails/new_no_accum}
 
    attr_accessor :type, :host
 
    def clear
        system("rm -rf #{path}")
    end
 
    def initialize
        @host = ARGV.shift
        @type = ARGV.shift
    end
 
    def path
        "/tmp/dbtest"
    end
 
    def run
        BRANCHES.each do |branch|
            run_branch(branch)
        end
    end
 
    def run_branch(branch)
        clear()
        system("git checkout #{branch}")
        exit unless $? == 0
 
        execute()
 
        execute if @type == "partial"
    end
 
    def execute
        system("~/tmp/stanford/tmp/trans2db --confdir #{path} --vardir #{path} ~/tmp/stanford/tmp/#{host}.yaml")
    end
end