Skip to content
Browse files

profiling enabled under JRuby. Added documentation for workaround des…

…cribed in JRUBY-5650.
  • Loading branch information...
1 parent b8f9a45 commit 677ce63d92b7725b0a11facddc1ba95f50f865df @goncalossilva goncalossilva committed Apr 3, 2011
View
7 activesupport/lib/active_support/testing/performance/jruby.rb
@@ -16,9 +16,7 @@ module Performance
protected
def run_gc
ManagementFactory.memory_mx_bean.gc
- end
-
- class Performer; end
+ end
class Profiler < Performer
def initialize(*args)
@@ -33,9 +31,6 @@ def run
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
View
6 activesupport/lib/active_support/testing/performance/rubinius.rb
@@ -84,19 +84,19 @@ def measure
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
View
10 activesupport/lib/active_support/testing/performance/ruby.rb
@@ -21,8 +21,6 @@ module Performance
def run_gc
GC.start
end
-
- class Performer; end
class Profiler < Performer
def initialize(*args)
@@ -128,28 +126,28 @@ class Memory < DigitalInformationUnit
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
View
2 activesupport/lib/active_support/testing/performance/ruby/mri.rb
@@ -24,8 +24,6 @@ def measure
end
end
end
-
- class Amount < Base; end
class Objects < Amount
# Ruby 1.8 + ruby-prof wrapper
View
4 railties/guides/source/performance_testing.textile
@@ -223,7 +223,7 @@ h6. Profiling
|_.Rubinius | yes | no | no | no | no | no | no | no |
|_.JRuby | yes | no | no | no | no | no | no | no |
-WARNING: Profiling under JRuby is currently unavailable because of a bug with rake and JRuby's +--profile.api+ option. You should resort exclusively to benchmarking.
+NOTE: To profile under JRuby you'll need to run +export JRUBY_OPTS="-Xlaunch.inproc=false --profile.api"+ *before* the performance tests.
h4. Understanding the Output
@@ -309,8 +309,6 @@ h6. Output Availability
|_.Rubinius | yes | yes | no |
|_.JRuby | yes | yes | no |
-WARNING: Again, profiling under JRuby is currently unavailable because of a bug with rake and JRuby's +--profile.api+ option.
-
h4. Tuning Test Runs
Test runs can be tuned by setting the +profile_options+ class variable on your test class.

0 comments on commit 677ce63

Please sign in to comment.
Something went wrong with that request. Please try again.