diff options
author | Gonçalo Silva <goncalossilva@gmail.com> | 2011-05-10 01:38:21 +0100 |
---|---|---|
committer | Gonçalo Silva <goncalossilva@gmail.com> | 2011-05-10 01:38:21 +0100 |
commit | 810fb2b5273591ff396ae9bcc1cf78b5d575c33d (patch) | |
tree | b1f88035b49bcd2473be6326a18447445051decf /activesupport/lib/active_support/testing | |
parent | 9ca97a6baf1e75c3ef4b69a993e6713b88c09e61 (diff) | |
download | rails-810fb2b5273591ff396ae9bcc1cf78b5d575c33d.tar.gz rails-810fb2b5273591ff396ae9bcc1cf78b5d575c33d.tar.bz2 rails-810fb2b5273591ff396ae9bcc1cf78b5d575c33d.zip |
benchmarker and profiler now use the new performance testing tools (support for Rubinius and JRuby and high configurability)
Diffstat (limited to 'activesupport/lib/active_support/testing')
-rw-r--r-- | activesupport/lib/active_support/testing/performance.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/testing/performance.rb b/activesupport/lib/active_support/testing/performance.rb index b62d9b16e1..4e970c034f 100644 --- a/activesupport/lib/active_support/testing/performance.rb +++ b/activesupport/lib/active_support/testing/performance.rb @@ -23,12 +23,15 @@ module ActiveSupport # each implementation should define metrics and freeze the defaults DEFAULTS = - if ARGV.include?('--benchmark') # HAX for rake test + if ARGV.include?('--benchmark') # HAX for rake test { :runs => 4, - :output => 'tmp/performance' } + :output => 'tmp/performance', + :benchmark => true } else + puts "not" { :runs => 1, - :output => 'tmp/performance' } + :output => 'tmp/performance', + :benchmark => false } end def full_profile_options @@ -130,7 +133,7 @@ module ActiveSupport end def run_profile(metric) - klass = ARGV.include?('--benchmark') ? Benchmarker : Profiler + klass = full_profile_options[:benchmark] ? Benchmarker : Profiler performer = klass.new(self, metric) performer.run |