Keep track of wait time per system type

I.e., how much time the currently runnable steps per system type have
been waiting. This is useful for deciding whether to provision more
machines.
This commit is contained in:
Eelco Dolstra
2015-08-17 15:45:44 +02:00
parent 99bfc37764
commit 092d60735b
3 changed files with 32 additions and 9 deletions

View File

@ -484,8 +484,11 @@ void State::dumpStatus(Connection & conn, bool log)
JSONObject nested2(out);
nested2.attr("runnable", i.second.runnable);
nested2.attr("running", i.second.running);
if (i.second.runnable > 0)
nested2.attr("waitTime", i.second.waitTime.count() +
i.second.runnable * (time(0) - lastDispatcherCheck));
if (i.second.running == 0)
nested2.attr("lastActive", i.second.lastActive);
nested2.attr("lastActive", std::chrono::system_clock::to_time_t(i.second.lastActive));
}
}
}