diff options
author | Gonçalo Silva <goncalossilva@gmail.com> | 2011-05-10 02:33:01 +0100 |
---|---|---|
committer | Gonçalo Silva <goncalossilva@gmail.com> | 2011-05-10 02:33:01 +0100 |
commit | dcc99e23cddab727fec2f7026bc30be18b07cee0 (patch) | |
tree | 0cc89d4c3eb05fea84f2e6a7d3aa466207ba3e45 /activesupport | |
parent | 9ca97a6baf1e75c3ef4b69a993e6713b88c09e61 (diff) | |
download | rails-dcc99e23cddab727fec2f7026bc30be18b07cee0.tar.gz rails-dcc99e23cddab727fec2f7026bc30be18b07cee0.tar.bz2 rails-dcc99e23cddab727fec2f7026bc30be18b07cee0.zip |
benchmarker and profiler now use the new performance testing tools (support for Rubinius and JRuby and high configurability)
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/testing/performance.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/testing/performance.rb b/activesupport/lib/active_support/testing/performance.rb index b62d9b16e1..f0287b0440 100644 --- a/activesupport/lib/active_support/testing/performance.rb +++ b/activesupport/lib/active_support/testing/performance.rb @@ -23,12 +23,14 @@ 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 { :runs => 1, - :output => 'tmp/performance' } + :output => 'tmp/performance', + :benchmark => false } end def full_profile_options @@ -130,7 +132,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 |