protected function computeNumberOfTargets()
    {
        $targets = [];

        /** @var ConnectionInterface[] $connections */
        $connections = $this->connections->getActiveConnections();
        foreach ($connections as $connection) {
            $stages = $this->connections->getAvailableStages();
            $connectionKey = $connection->getConnectionKey();

            $targets[$connectionKey->name] = count($connectionKey->servers) * count($stages);
        }

        return array_sum($targets);
    }