diff options
Diffstat (limited to 'actionpack/lib/action_controller/request_profiler.rb')
-rwxr-xr-x | actionpack/lib/action_controller/request_profiler.rb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/request_profiler.rb b/actionpack/lib/action_controller/request_profiler.rb index f33cbf49e8..3dcbddd49b 100755 --- a/actionpack/lib/action_controller/request_profiler.rb +++ b/actionpack/lib/action_controller/request_profiler.rb @@ -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 |