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:
Zach Dennis 2010-04-08 23:12:28 -04:00
parent 369a5e0e64
commit 5c287f1042
18 changed files with 509 additions and 22 deletions

15
benchmarks/lib/float.rb Normal file
View file

@ -0,0 +1,15 @@
# Taken from http://www.programmingishard.com/posts/show/128
# Posted by rbates
class Float
def round_to(x)
(self * 10**x).round.to_f / 10**x
end
def ceil_to(x)
(self * 10**x).ceil.to_f / 10**x
end
def floor_to(x)
(self * 10**x).floor.to_f / 10**x
end
end