Keep track of time required to load builds

This commit is contained in:
Eelco Dolstra
2016-03-08 13:09:14 +01:00
parent 2feb17c681
commit 718fef29ef
3 changed files with 9 additions and 0 deletions

View File

@ -247,6 +247,8 @@ bool State::getQueuedBuilds(Connection & conn, ref<Store> localStore,
if (i == newBuildsByID.end()) continue;
auto build = i->second;
auto now1 = std::chrono::steady_clock::now();
newRunnable.clear();
nrAdded = 0;
try {
@ -256,6 +258,10 @@ bool State::getQueuedBuilds(Connection & conn, ref<Store> localStore,
throw;
}
auto now2 = std::chrono::steady_clock::now();
buildReadTimeMs += std::chrono::duration_cast<std::chrono::milliseconds>(now2 - now1).count();
/* Add the new runnable build steps to runnable and wake up
the builder threads. */
printMsg(lvlChatty, format("got %1% new runnable steps from %2% new builds") % newRunnable.size() % nrAdded);