protected function numberOfWorkersPerQueue(Supervisor $supervisor, Collection $timeToClear)
    {
        $timeToClearAll = $timeToClear->sum();

        return $timeToClear->mapWithKeys(function ($timeToClear, $queue) use ($supervisor, $timeToClearAll) {
            return $timeToClearAll > 0 && $supervisor->options->autoScaling()
                    ? [$queue => (($timeToClear / $timeToClearAll) * $supervisor->options->maxProcesses)]
                    : [$queue => $supervisor->options->maxProcesses / count($supervisor->processPools)];
        })->sort();
    }