diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-16 03:45:20 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-16 03:45:20 -0700 |
commit | 899d63b997094f066ffd49a3e58d29c07143999d (patch) | |
tree | 062eb8cce82681449356dcc94effe5a89ab76b23 /activesupport/lib/active_support/testing/performance.rb | |
parent | e433bb16a6200351893077a723d4885c3080779f (diff) | |
download | rails-899d63b997094f066ffd49a3e58d29c07143999d.tar.gz rails-899d63b997094f066ffd49a3e58d29c07143999d.tar.bz2 rails-899d63b997094f066ffd49a3e58d29c07143999d.zip |
process time for benchmarks (quicker), wall time for profiling (lower overhead)
Diffstat (limited to 'activesupport/lib/active_support/testing/performance.rb')
-rw-r--r-- | activesupport/lib/active_support/testing/performance.rb | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/activesupport/lib/active_support/testing/performance.rb b/activesupport/lib/active_support/testing/performance.rb index b8e4f46d70..24936029a2 100644 --- a/activesupport/lib/active_support/testing/performance.rb +++ b/activesupport/lib/active_support/testing/performance.rb @@ -8,16 +8,20 @@ require 'rails/version' module ActiveSupport module Testing module Performance - benchmark = ARGV.include?('--benchmark') # HAX for rake test - - DEFAULTS = { - :benchmark => benchmark, - :runs => benchmark ? 10 : 1, - :min_percent => 0.02, - :metrics => [:process_time, :wall_time, :cpu_time, :memory, :objects], - :formats => [:flat, :graph_html, :call_tree], - :output => 'tmp/performance' - } + DEFAULTS = + if benchmark = ARGV.include?('--benchmark') # HAX for rake test + { :benchmark => true, + :runs => 10, + :metrics => [:process_time, :memory, :objects], + :output => 'tmp/performance' } + else + { :benchmark => false, + :runs => 1, + :min_percent => 0.02, + :metrics => [:wall_time, :memory, :objects], + :formats => [:flat, :graph_html, :call_tree], + :output => 'tmp/performance' } + end def self.included(base) base.class_inheritable_hash :profile_options |