summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-07 02:57:11 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-07 02:57:11 (GMT)
commit1ddb9c532233995a9c277e4a3b3367a37c4a44e4 (patch)
treee9f0e1f2debcb65d109de79bfa654536351b7323 /benchmark
parent11eb87013653ba6d2321ecf4db07fb052fe19a98 (diff)
* benchmark/driver.rb: add '--rawdata-output=[FILE] option to output
raw results into FILE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/driver.rb19
1 files changed, 17 insertions, 2 deletions
diff --git a/benchmark/driver.rb b/benchmark/driver.rb
index a8b524d9..1cd44b8 100644
--- a/benchmark/driver.rb
+++ b/benchmark/driver.rb
@@ -77,6 +77,7 @@ class BenchmarkDriver
@exclude = opt[:exclude] || nil
@verbose = opt[:quiet] ? false : (opt[:verbose] || false)
@output = opt[:output] ? open(opt[:output], 'w') : nil
+ @rawdata_output = opt[:rawdata_output] ? open(opt[:rawdata_output], 'w') : nil
@loop_wl1 = @loop_wl2 = nil
@ruby_arg = opt[:ruby_arg] || nil
@opt = opt
@@ -128,6 +129,15 @@ class BenchmarkDriver
message "Elapsed time: #{Time.now - @start_time} (sec)"
end
+ if @rawdata_output
+ h = {}
+ h[:cpuinfo] = File.read('/proc/cpuinfo') if File.exist?('/proc/cpuinfo')
+ h[:executables] = @execs
+ h[:results] = @results
+ pp h
+ # @rawdata_output.puts h.inspect
+ end
+
output '-----------------------------------------------------------'
output 'benchmark results:'
@@ -266,6 +276,7 @@ if __FILE__ == $0
:dir => File.dirname(__FILE__),
:repeat => 1,
:output => "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}",
+ :raw_output => nil
}
parser = OptionParser.new{|o|
@@ -293,12 +304,16 @@ if __FILE__ == $0
o.on('--ruby-arg [ARG]', "Optional argument for ruby"){|a|
opt[:ruby_arg] = a
}
- o.on('-q', '--quiet', "Run without notify information except result table."){|q|
- opt[:quiet] = q
+ o.on('--rawdata-output [FILE]', 'output rawdata'){|r|
+ opt[:rawdata_output] = r
}
o.on('-v', '--verbose'){|v|
opt[:verbose] = v
}
+ o.on('-q', '--quiet', "Run without notify information except result table."){|q|
+ opt[:quiet] = q
+ opt[:verbose] = false
+ }
}
parser.parse!(ARGV)