diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index 48970c3d..0d299cc2 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -179,9 +179,11 @@ void State::buildRemote(std::shared_ptr store, /* Copy the input closure. */ if (machine->sshName != "localhost") { - printMsg(lvlDebug, format("sending closure of ‘%1%’ to ‘%2%’") % step->drvPath % machine->sshName); - MaintainCount mc(nrStepsCopyingTo); + auto mc1 = std::make_shared(nrStepsWaiting); std::lock_guard sendLock(machine->state->sendLock); + mc1.reset(); + MaintainCount mc2(nrStepsCopyingTo); + printMsg(lvlDebug, format("sending closure of ‘%1%’ to ‘%2%’") % step->drvPath % machine->sshName); copyClosureTo(store, from, to, inputs, bytesSent); } diff --git a/src/hydra-queue-runner/hydra-queue-runner.cc b/src/hydra-queue-runner/hydra-queue-runner.cc index a07ec55f..44d488ef 100644 --- a/src/hydra-queue-runner/hydra-queue-runner.cc +++ b/src/hydra-queue-runner/hydra-queue-runner.cc @@ -1283,6 +1283,7 @@ void State::dumpStatus(Connection & conn, bool log) root.attr("nrStepsBuilding", nrStepsBuilding); root.attr("nrStepsCopyingTo", nrStepsCopyingTo); root.attr("nrStepsCopyingFrom", nrStepsCopyingFrom); + root.attr("nrStepsWaiting", nrStepsWaiting); root.attr("bytesSent"); out << bytesSent; root.attr("bytesReceived"); out << bytesReceived; root.attr("nrBuildsRead", nrBuildsRead); diff --git a/src/hydra-queue-runner/state.hh b/src/hydra-queue-runner/state.hh index b439a6b8..33103c13 100644 --- a/src/hydra-queue-runner/state.hh +++ b/src/hydra-queue-runner/state.hh @@ -203,6 +203,7 @@ private: counter nrStepsBuilding{0}; counter nrStepsCopyingTo{0}; counter nrStepsCopyingFrom{0}; + counter nrStepsWaiting{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 9ef2dce1..a96a1939 100755 --- a/src/script/hydra-send-stats +++ b/src/script/hydra-send-stats @@ -29,6 +29,7 @@ sub sendQueueRunnerStats { gauge("hydra.queue.steps.building", $json->{nrStepsBuilding}); gauge("hydra.queue.steps.copying_to", $json->{nrStepsCopyingTo}); gauge("hydra.queue.steps.copying_from", $json->{nrStepsCopyingFrom}); + gauge("hydra.queue.steps.waiting", $json->{nrStepsWaiting}); gauge("hydra.queue.steps.runnable", $json->{nrRunnableSteps}); gauge("hydra.queue.steps.unfinished", $json->{nrUnfinishedSteps}); gauge("hydra.queue.steps.finished", $json->{nrStepsDone});