1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

profiling enabled under JRuby. Added documentation for workaround described in JRUBY-5650.

This commit is contained in:
Gonçalo Silva 2011-04-03 01:09:34 +01:00
parent b8f9a45156
commit 677ce63d92
5 changed files with 9 additions and 20 deletions

View file

@ -18,8 +18,6 @@ module ActiveSupport
ManagementFactory.memory_mx_bean.gc
end
class Performer; end
class Profiler < Performer
def initialize(*args)
super
@ -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

View file

@ -22,8 +22,6 @@ module ActiveSupport
GC.start
end
class Performer; end
class Profiler < Performer
def initialize(*args)
super
@ -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

View file

@ -25,8 +25,6 @@ module ActiveSupport
end
end
class Amount < Base; end
class Objects < Amount
# Ruby 1.8 + ruby-prof wrapper
if RubyProf.respond_to?(:measure_allocations)

View file

@ -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.