From 9d616ea360b439b9204c68748553ebb00ce7ef90 Mon Sep 17 00:00:00 2001 From: Arun Agrawal Date: Fri, 11 May 2012 08:50:47 +0530 Subject: Update performance profiler to work with latest ruby-prof Thanks to @carlosantoniodasilva --- Gemfile | 2 +- activesupport/lib/active_support/testing/performance/ruby.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index a11091f075..0fc7fe3036 100644 --- a/Gemfile +++ b/Gemfile @@ -47,7 +47,7 @@ instance_eval File.read '.Gemfile' if File.exists? '.Gemfile' platforms :mri do group :test do - gem 'ruby-prof', '0.10.8' if RUBY_VERSION < '1.9.3' + gem 'ruby-prof', '~> 0.11.2' if RUBY_VERSION < '1.9.3' end end diff --git a/activesupport/lib/active_support/testing/performance/ruby.rb b/activesupport/lib/active_support/testing/performance/ruby.rb index 7d6d047ef6..96718d4bd3 100644 --- a/activesupport/lib/active_support/testing/performance/ruby.rb +++ b/activesupport/lib/active_support/testing/performance/ruby.rb @@ -36,7 +36,7 @@ module ActiveSupport RubyProf.pause full_profile_options[:runs].to_i.times { run_test(@metric, :profile) } @data = RubyProf.stop - @total = @data.threads.values.sum(0) { |method_infos| method_infos.max.total_time } + @total = @data.threads.sum(0) { |thread| thread.methods.max.total_time } end def record -- cgit v1.2.3 From 4b599611e4964adbdf7733831cb53de19d1f620f Mon Sep 17 00:00:00 2001 From: Arun Agrawal Date: Fri, 11 May 2012 08:54:45 +0530 Subject: Ruby-Prof works with ruby-1.9.3 also. --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 0fc7fe3036..ffddb50766 100644 --- a/Gemfile +++ b/Gemfile @@ -47,7 +47,7 @@ instance_eval File.read '.Gemfile' if File.exists? '.Gemfile' platforms :mri do group :test do - gem 'ruby-prof', '~> 0.11.2' if RUBY_VERSION < '1.9.3' + gem 'ruby-prof', '~> 0.11.2' end end -- cgit v1.2.3