AutoScaler
class AutoScaler
Methods
void
timeToClearPerQueue(Supervisor $supervisor, Collection $pools)
Get the times in milliseconds needed to clear the queues.
numberOfWorkersPerQueue(Supervisor $supervisor, Collection $queues)
Get the number of workers needed per queue for proper balance.
void
scalePool(Supervisor $supervisor, ProcessPool $pool, float $workers)
Scale the given pool to the recommended number of workers.
Details
at line 19
__construct(Factory $queue, MetricsRepository $metrics)
Create a new auto-scaler instance.
at line 28
void
scale(Supervisor $supervisor)
Balance the workers on the given supervisor.
at line 47
protected Collection
poolsByQueue(Supervisor $supervisor)
Get the process pools keyed by their queue name.
at line 57
protected Collection
timeToClearPerQueue(Supervisor $supervisor, Collection $pools)
Get the times in milliseconds needed to clear the queues.
at line 82
protected Collection
numberOfWorkersPerQueue(Supervisor $supervisor, Collection $queues)
Get the number of workers needed per queue for proper balance.
at line 124
protected void
scalePool(Supervisor $supervisor, ProcessPool $pool, float $workers)
Scale the given pool to the recommended number of workers.