diff options
author | Gonçalo Silva <goncalossilva@gmail.com> | 2011-03-25 19:03:59 +0000 |
---|---|---|
committer | Gonçalo Silva <goncalossilva@gmail.com> | 2011-03-25 19:10:47 +0000 |
commit | 278344b3fab67fcc471f475992a86c3748a83e23 (patch) | |
tree | a9f2c6dcfcad3ceaeb22d43c5cbbcd9bb52ac88d /activesupport/lib/active_support/testing/performance/rubinius.rb | |
parent | 417b2baf0fafc48dbfdab8a81b15836599a0613e (diff) | |
download | rails-278344b3fab67fcc471f475992a86c3748a83e23.tar.gz rails-278344b3fab67fcc471f475992a86c3748a83e23.tar.bz2 rails-278344b3fab67fcc471f475992a86c3748a83e23.zip |
fixed time and size units (should be seconds / bytes), fixed typo when counting memory allocations under rubinius
Diffstat (limited to 'activesupport/lib/active_support/testing/performance/rubinius.rb')
-rw-r--r-- | activesupport/lib/active_support/testing/performance/rubinius.rb | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/activesupport/lib/active_support/testing/performance/rubinius.rb b/activesupport/lib/active_support/testing/performance/rubinius.rb index ef4d2bd493..b9c7061571 100644 --- a/activesupport/lib/active_support/testing/performance/rubinius.rb +++ b/activesupport/lib/active_support/testing/performance/rubinius.rb @@ -9,19 +9,18 @@ module ActiveSupport end module Metrics - class Base + class Base + attr_reader :loopback + # TODO def profile yield end - - def loopback - @loopback ||= Rubinius::Agent.loopback - end protected # overridden by each implementation def with_gc_stats + @loopback = Rubinius::Agent.loopback GC.run(true) yield end @@ -53,7 +52,7 @@ module ActiveSupport class Objects < Amount def measure - loopback.get("system.memory.counter.bytes").last + loopback.get("system.memory.counter.objects").last end end @@ -65,7 +64,7 @@ module ActiveSupport class GcTime < Time def measure - loopback.get("system.gc.full.wallclock").last + loopback.get("system.gc.young.wallclock").last + (loopback.get("system.gc.full.wallclock").last + loopback.get("system.gc.young.wallclock").last) / 1000.0 end end end |