aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/testing
diff options
context:
space:
mode:
authorGonçalo Silva <goncalossilva@gmail.com>2011-05-10 03:40:44 +0100
committerGonçalo Silva <goncalossilva@gmail.com>2011-05-10 03:40:44 +0100
commit7fcf0ca69e18841be9fb0dcce2721f4ed2c8eca9 (patch)
treefb4b9bf3e1b94f8cb27a9a06af5476e9c72e39b9 /activesupport/lib/active_support/testing
parentaaa85cde6068f4db6fabe7bfef664f73bbc6938f (diff)
downloadrails-7fcf0ca69e18841be9fb0dcce2721f4ed2c8eca9.tar.gz
rails-7fcf0ca69e18841be9fb0dcce2721f4ed2c8eca9.tar.bz2
rails-7fcf0ca69e18841be9fb0dcce2721f4ed2c8eca9.zip
removed redundant metric support check (and print when it isn't)
Diffstat (limited to 'activesupport/lib/active_support/testing')
-rw-r--r--activesupport/lib/active_support/testing/performance.rb6
-rw-r--r--activesupport/lib/active_support/testing/performance/rubinius.rb6
2 files changed, 6 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/testing/performance.rb b/activesupport/lib/active_support/testing/performance.rb
index f0287b0440..02c19448fd 100644
--- a/activesupport/lib/active_support/testing/performance.rb
+++ b/activesupport/lib/active_support/testing/performance.rb
@@ -90,6 +90,8 @@ module ActiveSupport
if klass = Metrics[metric_name.to_sym]
run_profile(klass.new)
result.add_run
+ else
+ puts '%20s: unsupported' % metric_name
end
end
end
@@ -256,9 +258,7 @@ module ActiveSupport
@name ||= self.class.name.demodulize.underscore
end
- def benchmark
- @unsureturn if measure.nil?
-
+ def benchmark
with_gc_stats do
before = measure
yield
diff --git a/activesupport/lib/active_support/testing/performance/rubinius.rb b/activesupport/lib/active_support/testing/performance/rubinius.rb
index fbb58a2b3a..198d235548 100644
--- a/activesupport/lib/active_support/testing/performance/rubinius.rb
+++ b/activesupport/lib/active_support/testing/performance/rubinius.rb
@@ -84,19 +84,19 @@ module ActiveSupport
end
end
- class Memory < DigitalInformationUnit
+ class Memory < DigitalInformationUnit
def measure
loopback.get("system.memory.counter.bytes").last
end
end
- class Objects < Amount
+ class Objects < Amount
def measure
loopback.get("system.memory.counter.objects").last
end
end
- class GcRuns < Amount
+ class GcRuns < Amount
def measure
loopback.get("system.gc.full.count").last + loopback.get("system.gc.young.count").last
end