Skip to content

Commit c60e795

Browse files
K900mweinelt
authored andcommitted
Add metric for builds waiting for download slot
(cherry picked from commit f23ec71227911891807706b6b978836e4d80edde)
1 parent 90399cb commit c60e795

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

src/hydra-queue-runner/build-remote.cc

+1
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,7 @@ void State::buildRemote(ref<Store> destStore,
565565
/* Throttle CPU-bound work. Opportunistically skip updating the current
566566
* step, since this requires a DB roundtrip. */
567567
if (!localWorkThrottler.try_acquire()) {
568+
MaintainCount<counter> mc(nrStepsWaitingForDownloadSlot);
568569
updateStep(ssWaitingForLocalSlot);
569570
localWorkThrottler.acquire();
570571
}

src/hydra-queue-runner/hydra-queue-runner.cc

+1
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,7 @@ void State::dumpStatus(Connection & conn)
612612
{"nrActiveSteps", activeSteps_.lock()->size()},
613613
{"nrStepsBuilding", nrStepsBuilding.load()},
614614
{"nrStepsCopyingTo", nrStepsCopyingTo.load()},
615+
{"nrStepsWaitingForDownloadSlot", nrStepsWaitingForDownloadSlot.load()},
615616
{"nrStepsCopyingFrom", nrStepsCopyingFrom.load()},
616617
{"nrStepsWaiting", nrStepsWaiting.load()},
617618
{"nrUnsupportedSteps", nrUnsupportedSteps.load()},

src/hydra-queue-runner/state.hh

+1
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ private:
376376
counter nrStepsDone{0};
377377
counter nrStepsBuilding{0};
378378
counter nrStepsCopyingTo{0};
379+
counter nrStepsWaitingForDownloadSlot{0};
379380
counter nrStepsCopyingFrom{0};
380381
counter nrStepsWaiting{0};
381382
counter nrUnsupportedSteps{0};

0 commit comments

Comments
 (0)