Fix hydra.queue.machines.total stat

This was broken by the fact that "machines" now also contains
removed/disabled machines.
This commit is contained in:
Eelco Dolstra 2015-09-22 12:59:19 +02:00
parent f8141fdc98
commit ae2cc61be6

View file

@ -49,7 +49,7 @@ sub sendQueueRunnerStats {
gauge("hydra.queue.bytes_sent", $json->{bytesSent});
gauge("hydra.queue.bytes_received", $json->{bytesReceived});
gauge("hydra.queue.machines.total", scalar(keys %{$json->{machines}}));
gauge("hydra.queue.machines.total", scalar(grep { $_->{enabled} } (values %{$json->{machines}})));
gauge("hydra.queue.machines.in_use", scalar(grep { $_->{currentJobs} > 0 } (values %{$json->{machines}})));
}