Record metrics when getting the closure to localhost

This commit is contained in:
Graham Christensen 2022-01-21 15:35:47 -05:00
parent 7e9e82398d
commit ba96a13407

View file

@ -270,21 +270,24 @@ void State::buildRemote(ref<Store> destStore,
copyPaths(*localStore, *destStore, closure, NoRepair, NoCheckSigs, NoSubstitute); copyPaths(*localStore, *destStore, closure, NoRepair, NoCheckSigs, NoSubstitute);
} }
{
auto mc1 = std::make_shared<MaintainCount<counter>>(nrStepsWaiting);
mc1.reset();
MaintainCount<counter> mc2(nrStepsCopyingTo);
printMsg(lvlDebug, "sending closure of %s to %s",
localStore->printStorePath(step->drvPath), machine->sshName);
auto now1 = std::chrono::steady_clock::now();
/* Copy the input closure. */ /* Copy the input closure. */
if (machine->isLocalhost()) { if (machine->isLocalhost()) {
StorePathSet closure; StorePathSet closure;
destStore->computeFSClosure(inputs, closure); destStore->computeFSClosure(inputs, closure);
copyPaths(*destStore, *localStore, closure, NoRepair, NoCheckSigs, NoSubstitute); copyPaths(*destStore, *localStore, closure, NoRepair, NoCheckSigs, NoSubstitute);
} else { } else {
auto mc1 = std::make_shared<MaintainCount<counter>>(nrStepsWaiting);
mc1.reset();
MaintainCount<counter> mc2(nrStepsCopyingTo);
printMsg(lvlDebug, "sending closure of %s to %s",
localStore->printStorePath(step->drvPath), machine->sshName);
auto now1 = std::chrono::steady_clock::now();
copyClosureTo(machine->state->sendLock, destStore, from, to, inputs, true); copyClosureTo(machine->state->sendLock, destStore, from, to, inputs, true);
}
auto now2 = std::chrono::steady_clock::now(); auto now2 = std::chrono::steady_clock::now();