protected function execute(InputInterface $input, OutputInterface $output)
{
$hosts = Resque\Redis::instance()->smembers(Resque\Host::redisKey());
if (empty($hosts)) {
$this->log('<warn>There are no hosts with running workers.</warn>');
return;
}
$table = new Resque\Helpers\Table($this);
$table->setHeaders(array('#', 'Hostname', '# workers'));
foreach ($hosts as $i => $hostname) {
$host = new Resque\Host($hostname);
$workers = Resque\Redis::instance()->scard(Resque\Host::redisKey($host));
$table->addRow(array($i + 1, $hostname, $workers));
}
$this->log((string) $table);
}