1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

expose old_worker_count in stats url

This allows one to write a script that waits for the result of a
phased-restart command to complete
This commit is contained in:
Ben Osheroff 2016-01-15 09:20:47 -08:00
parent 246e71840e
commit 6c7e9508e8

View file

@ -284,7 +284,9 @@ module Puma
end
def stats
%Q!{ "workers": #{@workers.size}, "phase": #{@phase}, "booted_workers": #{@workers.count{|w| w.booted?}} }!
old_worker_count = @workers.count { |w| w.phase != @phase }
booted_worker_count = @workers.count { |w| w.booted? }
%Q!{ "workers": #{@workers.size}, "phase": #{@phase}, "booted_workers": #{booted_worker_count}, "old_workers": #{old_worker_count} }!
end
def preload?