From ae2cc61be63550e0b67ea82c60defdaf2da5d99b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 22 Sep 2015 12:59:19 +0200 Subject: [PATCH] Fix hydra.queue.machines.total stat This was broken by the fact that "machines" now also contains removed/disabled machines. --- src/script/hydra-send-stats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/hydra-send-stats b/src/script/hydra-send-stats index 600405c5..c99bc367 100755 --- a/src/script/hydra-send-stats +++ b/src/script/hydra-send-stats @@ -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}}))); }