Merge pull request #556 from AmineChikhaoui/machine-types-stats

add some more statistics about runnable/running builds per arch/system features
This commit is contained in:
Eelco Dolstra 2018-06-12 14:02:57 +02:00 committed by GitHub
commit cff52ab151
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,6 +39,11 @@ sub sendQueueRunnerStats {
gauge("hydra.queue.steps.avg_total_time", $json->{avgStepTime});
gauge("hydra.queue.steps.avg_build_time", $json->{avgStepBuildTime});
}
foreach my $machine (keys %{$json->{machineTypes}}) {
my $machineType = $machine =~ s/:|,/_/r;
gauge("hydra.queue.$machineType.runnable", $json->{machineTypes}->{$machine}->{runnable});
gauge("hydra.queue.$machineType.running", $json->{machineTypes}->{$machine}->{running});
}
gauge("hydra.queue.builds.read", $json->{nrBuildsRead});
gauge("hydra.queue.builds.unfinished", $json->{nrQueuedBuilds});
@ -51,6 +56,12 @@ sub sendQueueRunnerStats {
gauge("hydra.queue.machines.total", scalar(grep { $_->{enabled} } (values %{$json->{machines}})));
gauge("hydra.queue.machines.in_use", scalar(grep { $_->{currentJobs} > 0 } (values %{$json->{machines}})));
gauge("hydra.queue.notification.time_avg_ms", $json->{nrNotificationTimeAvgMs});
gauge("hydra.queue.notification.time_ms", $json->{nrNotificationTimeMs});
gauge("hydra.queue.notification.done", $json->{nrNotificationsDone});
gauge("hydra.queue.notification.failed", $json->{nrNotificationsFailed});
gauge("hydra.queue.notification.in_progress", $json->{nrNotificationsInProgress});
gauge("hydra.queue.notification.pending", $json->{nrNotificationsPending});
}
while (1) {