From ccd046ca3db27222b4aaf7644f9fdb2e5c7da328 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 26 Mar 2020 15:26:12 +0100 Subject: [PATCH] Keep track of the number of unsupported steps (cherry picked from commit 45ffe578b695f9de101b30d44d46f12aa0654f10) --- src/hydra-queue-runner/dispatcher.cc | 7 +++++++ src/hydra-queue-runner/hydra-queue-runner.cc | 1 + src/hydra-queue-runner/state.hh | 1 + src/script/hydra-send-stats | 1 + 4 files changed, 10 insertions(+) diff --git a/src/hydra-queue-runner/dispatcher.cc b/src/hydra-queue-runner/dispatcher.cc index 700fdd8e..6dc7f700 100644 --- a/src/hydra-queue-runner/dispatcher.cc +++ b/src/hydra-queue-runner/dispatcher.cc @@ -328,6 +328,8 @@ void State::abortUnsupported() std::unordered_set aborted; + size_t count = 0; + for (auto & wstep : runnable2) { auto step(wstep.lock()); if (!step) continue; @@ -341,6 +343,9 @@ void State::abortUnsupported() } } + if (!supported) + count++; + if (!supported && std::chrono::duration_cast(now - step->state.lock()->lastSupported).count() >= maxUnsupportedTime) { @@ -396,6 +401,8 @@ void State::abortUnsupported() ++i; } } + + nrUnsupportedSteps = count; } diff --git a/src/hydra-queue-runner/hydra-queue-runner.cc b/src/hydra-queue-runner/hydra-queue-runner.cc index f7ecf268..8d729bd1 100644 --- a/src/hydra-queue-runner/hydra-queue-runner.cc +++ b/src/hydra-queue-runner/hydra-queue-runner.cc @@ -523,6 +523,7 @@ void State::dumpStatus(Connection & conn, bool log) root.attr("nrStepsCopyingTo", nrStepsCopyingTo); root.attr("nrStepsCopyingFrom", nrStepsCopyingFrom); root.attr("nrStepsWaiting", nrStepsWaiting); + root.attr("nrUnsupportedSteps", nrUnsupportedSteps); root.attr("bytesSent", bytesSent); root.attr("bytesReceived", bytesReceived); root.attr("nrBuildsRead", nrBuildsRead); diff --git a/src/hydra-queue-runner/state.hh b/src/hydra-queue-runner/state.hh index 4d87a3a7..c702e8a3 100644 --- a/src/hydra-queue-runner/state.hh +++ b/src/hydra-queue-runner/state.hh @@ -355,6 +355,7 @@ private: counter nrStepsCopyingTo{0}; counter nrStepsCopyingFrom{0}; counter nrStepsWaiting{0}; + counter nrUnsupportedSteps{0}; counter nrRetries{0}; counter maxNrRetries{0}; counter totalStepTime{0}; // total time for steps, including closure copying diff --git a/src/script/hydra-send-stats b/src/script/hydra-send-stats index 2b8c550b..cf653865 100755 --- a/src/script/hydra-send-stats +++ b/src/script/hydra-send-stats @@ -34,6 +34,7 @@ sub sendQueueRunnerStats { gauge("hydra.queue.steps.unfinished", $json->{nrUnfinishedSteps}); gauge("hydra.queue.steps.finished", $json->{nrStepsDone}); gauge("hydra.queue.steps.retries", $json->{nrRetries}); + gauge("hydra.queue.steps.unsupported", $json->{nrUnsupportedSteps}); gauge("hydra.queue.steps.max_retries", $json->{maxNrRetries}); if ($json->{nrStepsDone}) { gauge("hydra.queue.steps.avg_total_time", $json->{avgStepTime});