Keep track of the number of unsupported steps

(cherry picked from commit 45ffe578b6)
This commit is contained in:
Eelco Dolstra 2020-03-26 15:26:12 +01:00
parent 4417f9f260
commit ccd046ca3d
4 changed files with 10 additions and 0 deletions

View file

@ -328,6 +328,8 @@ void State::abortUnsupported()
std::unordered_set<Step::ptr> aborted; std::unordered_set<Step::ptr> aborted;
size_t count = 0;
for (auto & wstep : runnable2) { for (auto & wstep : runnable2) {
auto step(wstep.lock()); auto step(wstep.lock());
if (!step) continue; if (!step) continue;
@ -341,6 +343,9 @@ void State::abortUnsupported()
} }
} }
if (!supported)
count++;
if (!supported if (!supported
&& std::chrono::duration_cast<std::chrono::seconds>(now - step->state.lock()->lastSupported).count() >= maxUnsupportedTime) && std::chrono::duration_cast<std::chrono::seconds>(now - step->state.lock()->lastSupported).count() >= maxUnsupportedTime)
{ {
@ -396,6 +401,8 @@ void State::abortUnsupported()
++i; ++i;
} }
} }
nrUnsupportedSteps = count;
} }

View file

@ -523,6 +523,7 @@ void State::dumpStatus(Connection & conn, bool log)
root.attr("nrStepsCopyingTo", nrStepsCopyingTo); root.attr("nrStepsCopyingTo", nrStepsCopyingTo);
root.attr("nrStepsCopyingFrom", nrStepsCopyingFrom); root.attr("nrStepsCopyingFrom", nrStepsCopyingFrom);
root.attr("nrStepsWaiting", nrStepsWaiting); root.attr("nrStepsWaiting", nrStepsWaiting);
root.attr("nrUnsupportedSteps", nrUnsupportedSteps);
root.attr("bytesSent", bytesSent); root.attr("bytesSent", bytesSent);
root.attr("bytesReceived", bytesReceived); root.attr("bytesReceived", bytesReceived);
root.attr("nrBuildsRead", nrBuildsRead); root.attr("nrBuildsRead", nrBuildsRead);

View file

@ -355,6 +355,7 @@ private:
counter nrStepsCopyingTo{0}; counter nrStepsCopyingTo{0};
counter nrStepsCopyingFrom{0}; counter nrStepsCopyingFrom{0};
counter nrStepsWaiting{0}; counter nrStepsWaiting{0};
counter nrUnsupportedSteps{0};
counter nrRetries{0}; counter nrRetries{0};
counter maxNrRetries{0}; counter maxNrRetries{0};
counter totalStepTime{0}; // total time for steps, including closure copying counter totalStepTime{0}; // total time for steps, including closure copying

View file

@ -34,6 +34,7 @@ sub sendQueueRunnerStats {
gauge("hydra.queue.steps.unfinished", $json->{nrUnfinishedSteps}); gauge("hydra.queue.steps.unfinished", $json->{nrUnfinishedSteps});
gauge("hydra.queue.steps.finished", $json->{nrStepsDone}); gauge("hydra.queue.steps.finished", $json->{nrStepsDone});
gauge("hydra.queue.steps.retries", $json->{nrRetries}); gauge("hydra.queue.steps.retries", $json->{nrRetries});
gauge("hydra.queue.steps.unsupported", $json->{nrUnsupportedSteps});
gauge("hydra.queue.steps.max_retries", $json->{maxNrRetries}); gauge("hydra.queue.steps.max_retries", $json->{maxNrRetries});
if ($json->{nrStepsDone}) { if ($json->{nrStepsDone}) {
gauge("hydra.queue.steps.avg_total_time", $json->{avgStepTime}); gauge("hydra.queue.steps.avg_total_time", $json->{avgStepTime});