WaitTimeCalculator
class WaitTimeCalculator
Methods
Create a new calculator instance.
Calculate the time to clear a given queue in seconds.
Calculate the time to clear per queue in seconds.
Get the total process count for a given queue.
Calculate the time to clear for the given queue in seconds distributed over the given amount of processes.
Get the total time to clear (in milliseconds) for a given queue.
Details
at line 18
__construct(Factory $queue, SupervisorRepository $supervisors, MetricsRepository $metrics)
Create a new calculator instance.
at line 28
float
calculateFor(string $queue)
Calculate the time to clear a given queue in seconds.
at line 38
array
calculate(string|null $queue = null)
Calculate the time to clear per queue in seconds.
at line 57
protected Collection
queueNames(Collection $supervisors, string|null $queue = null)
Get all of the queue names.
at line 71
protected int
totalProcessesFor(Collection $allSupervisors, string $queue)
Get the total process count for a given queue.
at line 81
float
calculateTimeToClear(string $connection, string $queue, int $totalProcesses)
Calculate the time to clear for the given queue in seconds distributed over the given amount of processes.
at line 97
protected float
timeToClearFor(string $connection, string $queue)
Get the total time to clear (in milliseconds) for a given queue.