File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1347,6 +1347,7 @@ void DerivationGoal::tryToBuild()
13471347 case rpAccept:
13481348 /* Yes, it has started doing so. Wait until we get
13491349 EOF from the hook. */
1350+ result.startTime = time (0 ); // inexact
13501351 state = &DerivationGoal::buildDone;
13511352 return ;
13521353 case rpPostpone:
@@ -1424,6 +1425,7 @@ void DerivationGoal::buildDone()
14241425 debug (format (" builder process for ‘%1%’ finished" ) % drvPath);
14251426
14261427 result.timesBuilt ++;
1428+ result.stopTime = time (0 );
14271429
14281430 /* So the child is gone now. */
14291431 worker.childTerminated (this );
@@ -2108,6 +2110,8 @@ void DerivationGoal::startBuilder()
21082110 /* Create a pipe to get the output of the builder. */
21092111 builderOut.create ();
21102112
2113+ result.startTime = time (0 );
2114+
21112115 /* Fork a child to build the package. */
21122116#if __linux__
21132117 if (useChroot) {
Original file line number Diff line number Diff line change @@ -218,7 +218,9 @@ struct BuildResult
218218 non-determinism.) */
219219 bool isNonDeterministic = false ;
220220
221- // time_t startTime = 0, stopTime = 0;
221+ /* The start/stop times of the build (or one of the rounds, if it
222+ was repeated). */
223+ time_t startTime = 0 , stopTime = 0 ;
222224
223225 bool success () {
224226 return status == Built || status == Substituted || status == AlreadyValid;
Original file line number Diff line number Diff line change @@ -961,7 +961,7 @@ static void opServe(Strings opFlags, Strings opArgs)
961961 out << status.status << status.errorMsg ;
962962
963963 if (GET_PROTOCOL_MINOR (clientVersion) >= 3 )
964- out << status.timesBuilt << status.isNonDeterministic ;
964+ out << status.timesBuilt << status.isNonDeterministic << status. startTime << status. stopTime ;
965965
966966 break ;
967967 }
You can’t perform that action at this time.
0 commit comments