Revive jobset scheduling

(I.e. taking the jobset scheduling share into account.)
This commit is contained in:
Eelco Dolstra
2015-08-11 01:30:24 +02:00
parent 08739a2a5a
commit 97f11baa8d
5 changed files with 154 additions and 4 deletions

View File

@ -131,6 +131,16 @@ bool State::doBuildStep(std::shared_ptr<StoreAPI> store, Step::ptr step,
time_t stepStopTime = time(0);
if (!result.stopTime) result.stopTime = stepStopTime;
/* Account the time we spent building this step by dividing it
among the jobsets that depend on it. */
{
auto step_(step->state.lock());
// FIXME: loss of precision.
time_t charge = (result.stopTime - result.startTime) / step_->jobsets.size();
for (auto & jobset : step_->jobsets)
jobset->addStep(result.startTime, charge);
}
/* Asynchronously compress the log. */
if (result.logFile != "") {
{