Added back in basic benchmark support. To run:
ruby benchmark/benchmark.rb --adapter mysql --num 1000 ruby benchmark/benchmark.rb --adapter mysql --num 1000 --to-csv /tmp/results.csv ruby benchmark/benchmark.rb --adapter mysql --num 1000 --to-html /tmp/results.html
This commit is contained in:
parent
369a5e0e64
commit
5c287f1042
18 changed files with 509 additions and 22 deletions
18
benchmarks/lib/output_to_csv.rb
Normal file
18
benchmarks/lib/output_to_csv.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
require 'fastercsv'
|
||||
|
||||
module OutputToCSV
|
||||
def self.output_results( filename, results )
|
||||
FasterCSV.open( filename, 'w' ) do |csv|
|
||||
# Iterate over each result set, which contains many results
|
||||
results.each do |result_set|
|
||||
columns, times = [], []
|
||||
result_set.each do |result|
|
||||
columns << result.description
|
||||
times << result.tms.real
|
||||
end
|
||||
csv << columns
|
||||
csv << times
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue