Permalink
Browse files

benchmarking metrics are also implementation-specific

  • Loading branch information...
goncalossilva committed Mar 28, 2011
1 parent e17f608 commit e6cb3962bb51aa1f91487117b99e660cc2c43e37
@@ -1,9 +1,21 @@
+require 'jruby/profiler'
+require 'java'
+import java.lang.management.ManagementFactory
+
module ActiveSupport
module Testing
- module Performance
+ module Performance
+ if ARGV.include?('--benchmark')
+ DEFAULTS.merge!({:metrics => [:wall_time, :user_time, :memory, :gc_runs, :gc_time, :ola]})
+ else
+ DEFAULTS.merge!(
+ { :metrics => [:wall_time],
+ :formats => [:flat, :graph] })
+ end
+
protected
def run_gc
- GC.start
+ ManagementFactory.memory_mx_bean.gc
end
class Performer; end
@@ -3,7 +3,9 @@
module ActiveSupport
module Testing
module Performance
- if !ARGV.include?('--benchmark')
+ if ARGV.include?('--benchmark')
+ DEFAULTS.merge!({:metrics => [:wall_time, :memory, :objects, :gc_runs, :gc_time]})
+ else
DEFAULTS.merge!(
{ :metrics => [:wall_time],
:formats => [:flat, :graph] })
@@ -8,7 +8,9 @@
module ActiveSupport
module Testing
module Performance
- if !ARGV.include?('--benchmark')
+ if ARGV.include?('--benchmark')
+ DEFAULTS.merge!({:metrics => [:wall_time, :memory, :objects, :gc_runs, :gc_time]})
+ else
DEFAULTS.merge!(
{ :min_percent => 0.01,
:metrics => [:process_time, :memory, :objects],

0 comments on commit e6cb396

Please sign in to comment.