aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorGonçalo Silva <goncalossilva@gmail.com>2011-04-03 01:09:34 +0100
committerGonçalo Silva <goncalossilva@gmail.com>2011-04-03 02:02:03 +0100
commit677ce63d92b7725b0a11facddc1ba95f50f865df (patch)
tree79dea5461f31dd47d2ab0ec523853c8b3c682873 /activesupport/lib
parentb8f9a4515682f2722dc6e8ff9c106f5f774e703b (diff)
downloadrails-677ce63d92b7725b0a11facddc1ba95f50f865df.tar.gz
rails-677ce63d92b7725b0a11facddc1ba95f50f865df.tar.bz2
rails-677ce63d92b7725b0a11facddc1ba95f50f865df.zip
profiling enabled under JRuby. Added documentation for workaround described in JRUBY-5650.
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/testing/performance/jruby.rb7
-rw-r--r--activesupport/lib/active_support/testing/performance/rubinius.rb6
-rw-r--r--activesupport/lib/active_support/testing/performance/ruby.rb10
-rw-r--r--activesupport/lib/active_support/testing/performance/ruby/mri.rb2
4 files changed, 8 insertions, 17 deletions
diff --git a/activesupport/lib/active_support/testing/performance/jruby.rb b/activesupport/lib/active_support/testing/performance/jruby.rb
index 6993db1a3b..9beadba310 100644
--- a/activesupport/lib/active_support/testing/performance/jruby.rb
+++ b/activesupport/lib/active_support/testing/performance/jruby.rb
@@ -16,9 +16,7 @@ module ActiveSupport
protected
def run_gc
ManagementFactory.memory_mx_bean.gc
- end
-
- class Performer; end
+ end
class Profiler < Performer
def initialize(*args)
@@ -33,9 +31,6 @@ module ActiveSupport
full_profile_options[:runs].to_i.times { run_test(@metric, :profile) }
end
- profile_printer = JRuby::Profiler::GraphProfilePrinter.new(@data)
- profile_printer.printProfile(STDOUT)
-
@total = @data.getDuration / 1000 / 1000 / 1000.0 # seconds
end
diff --git a/activesupport/lib/active_support/testing/performance/rubinius.rb b/activesupport/lib/active_support/testing/performance/rubinius.rb
index b2e77b3ce9..fafa782e8d 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
diff --git a/activesupport/lib/active_support/testing/performance/ruby.rb b/activesupport/lib/active_support/testing/performance/ruby.rb
index e887af1979..0d40dcd22a 100644
--- a/activesupport/lib/active_support/testing/performance/ruby.rb
+++ b/activesupport/lib/active_support/testing/performance/ruby.rb
@@ -21,8 +21,6 @@ module ActiveSupport
def run_gc
GC.start
end
-
- class Performer; end
class Profiler < Performer
def initialize(*args)
@@ -128,28 +126,28 @@ module ActiveSupport
Mode = RubyProf::MEMORY if RubyProf.const_defined?(:MEMORY)
# overridden by each implementation
- def measure; 0; end
+ def measure; end
end
class Objects < Amount
Mode = RubyProf::ALLOCATIONS if RubyProf.const_defined?(:ALLOCATIONS)
# overridden by each implementation
- def measure; 0; end
+ def measure; end
end
class GcRuns < Amount
Mode = RubyProf::GC_RUNS if RubyProf.const_defined?(:GC_RUNS)
# overridden by each implementation
- def measure; 0; end
+ def measure; end
end
class GcTime < Time
Mode = RubyProf::GC_TIME if RubyProf.const_defined?(:GC_TIME)
# overridden by each implementation
- def measure; 0; end
+ def measure; end
end
end
end
diff --git a/activesupport/lib/active_support/testing/performance/ruby/mri.rb b/activesupport/lib/active_support/testing/performance/ruby/mri.rb
index 22c31927f0..86e650050b 100644
--- a/activesupport/lib/active_support/testing/performance/ruby/mri.rb
+++ b/activesupport/lib/active_support/testing/performance/ruby/mri.rb
@@ -24,8 +24,6 @@ module ActiveSupport
end
end
end
-
- class Amount < Base; end
class Objects < Amount
# Ruby 1.8 + ruby-prof wrapper