aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/testing/performance
diff options
context:
space:
mode:
authorGonçalo Silva <goncalossilva@gmail.com>2011-04-03 03:16:35 +0100
committerGonçalo Silva <goncalossilva@gmail.com>2011-04-03 03:16:35 +0100
commit8d558cb1b069410c8f693295c9c4e2ffc9661e06 (patch)
treedf5dedcc521e0dbe7cad3a0049078d30da00b4d8 /activesupport/lib/active_support/testing/performance
parent65022acda0d407b28249988ab2c715d2a8256702 (diff)
downloadrails-8d558cb1b069410c8f693295c9c4e2ffc9661e06.tar.gz
rails-8d558cb1b069410c8f693295c9c4e2ffc9661e06.tar.bz2
rails-8d558cb1b069410c8f693295c9c4e2ffc9661e06.zip
don't use internal profiler methods on Rubinius and JRuby since we're only measuring wall clock for now (and the APIs will/can change, respectively)
Diffstat (limited to 'activesupport/lib/active_support/testing/performance')
-rw-r--r--activesupport/lib/active_support/testing/performance/jruby.rb8
-rw-r--r--activesupport/lib/active_support/testing/performance/rubinius.rb8
2 files changed, 8 insertions, 8 deletions
diff --git a/activesupport/lib/active_support/testing/performance/jruby.rb b/activesupport/lib/active_support/testing/performance/jruby.rb
index 9beadba310..6b27959840 100644
--- a/activesupport/lib/active_support/testing/performance/jruby.rb
+++ b/activesupport/lib/active_support/testing/performance/jruby.rb
@@ -27,11 +27,11 @@ module ActiveSupport
def run
return unless @supported
- @data = JRuby::Profiler.profile do
- full_profile_options[:runs].to_i.times { run_test(@metric, :profile) }
+ @total = time_with_block do
+ @data = JRuby::Profiler.profile do
+ full_profile_options[:runs].to_i.times { run_test(@metric, :profile) }
+ end
end
-
- @total = @data.getDuration / 1000 / 1000 / 1000.0 # seconds
end
def record
diff --git a/activesupport/lib/active_support/testing/performance/rubinius.rb b/activesupport/lib/active_support/testing/performance/rubinius.rb
index fafa782e8d..fbb58a2b3a 100644
--- a/activesupport/lib/active_support/testing/performance/rubinius.rb
+++ b/activesupport/lib/active_support/testing/performance/rubinius.rb
@@ -29,11 +29,11 @@ module ActiveSupport
@profiler = Rubinius::Profiler::Instrumenter.new
- @profiler.profile(false) do
- full_profile_options[:runs].to_i.times { run_test(@metric, :profile) }
+ @total = time_with_block do
+ @profiler.profile(false) do
+ full_profile_options[:runs].to_i.times { run_test(@metric, :profile) }
+ end
end
-
- @total = @profiler.info[:runtime] / 1000 / 1000 / 1000.0 # seconds
end
def record