mirror of
https://github.com/github/rails.git
synced 2026-02-05 11:45:13 -05:00
Request profiler resets after warmup and each run so you don't have to do it in your session script.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8475 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -23,8 +23,8 @@ module ActionController
|
||||
result = Benchmark.realtime do
|
||||
n.times do |i|
|
||||
run
|
||||
print i % 10 == 0 ? 'x' : '.'
|
||||
$stdout.flush
|
||||
reset!
|
||||
print_progress(i)
|
||||
end
|
||||
end
|
||||
puts
|
||||
@@ -42,6 +42,13 @@ module ActionController
|
||||
script = File.read(script_path)
|
||||
instance_eval "def run; #{script}; end", script_path, 1
|
||||
end
|
||||
|
||||
def print_progress(i)
|
||||
print "\n " if i % 60 == 0
|
||||
print ' ' if i % 10 == 0
|
||||
print '.'
|
||||
$stdout.flush
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -87,7 +94,10 @@ module ActionController
|
||||
end
|
||||
|
||||
def warmup(sandbox)
|
||||
Benchmark.realtime { sandbox.run }
|
||||
Benchmark.realtime do
|
||||
sandbox.run
|
||||
sandbox.reset!
|
||||
end
|
||||
end
|
||||
|
||||
def default_options
|
||||
|
||||
Reference in New Issue
Block a user