def run_urls_without_benchmark(gc_stats)
svl = nil
begin
if ARGV.include?('-svlPV')
require 'svlRubyPV'
svl = SvlRubyPV.new
elsif ARGV.include?('-svlMV')
require 'svlRubyMV'
svl = SvlRubyMV.new
end
rescue LoadError
end
ruby_prof = nil
ARGV.each{|arg| ruby_prof=$1 if arg =~ /-ruby_prof=([^ ]*)/ }
begin
if ruby_prof
if benchmark_file = ENV['RAILS_BENCHMARK_FILE']
$stderr = File.open(benchmark_file, "w")
end
require 'ruby-prof'
RubyProf.clock_mode = RubyProf::WALL_TIME
RubyProf.start
end
rescue LoadError
$stderr = STDERR
$stderr.puts "ruby-prof not available: giving up"
exit(-1)
end
if svl
svl.startProfiler
svl.startDataCollection
end
setup_initial_env
GC.enable_stats if gc_stats
if gc_frequency==0
run_urls_without_benchmark_and_without_gc_control(@urls, iterations)
else
run_urls_without_benchmark_but_with_gc_control(@urls, iterations, gc_frequency)
end
if gc_stats
GC.enable if gc_frequency
GC.start
GC.dump
GC.disable_stats
GC.log "number of requests processed: #{@urls.size * iterations}"
end
svl.stopDataCollection if svl
if defined? RubyProf
result = RubyProf.stop
printer = RubyProf::GraphHtmlPrinter.new(result)
printer.print($stderr, ruby_prof.to_f)
end
delete_test_session
delete_new_test_sessions
end