diff options
Diffstat (limited to 'activesupport/lib/active_support')
-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 |