Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

benchmarking metrics are also implementation-specific

  • Loading branch information...
commit e6cb3962bb51aa1f91487117b99e660cc2c43e37 1 parent e17f608
@goncalossilva goncalossilva authored
View
16 activesupport/lib/active_support/testing/performance/jruby.rb
@@ -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
View
4 activesupport/lib/active_support/testing/performance/rubinius.rb
@@ -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] })
View
4 activesupport/lib/active_support/testing/performance/ruby.rb
@@ -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],
Please sign in to comment.
Something went wrong with that request. Please try again.