nix-output-monitor icon indicating copy to clipboard operation
nix-output-monitor copied to clipboard

[feature request] aggregrated historical time

Open symphorien opened this issue 3 years ago • 3 comments

When the time taken by previous builds of some of the dependencies is known, would it be possible to display the sum? It can be understood as a lower bound on the time we can expect the whole build to take.

symphorien avatar Sep 12 '22 19:09 symphorien

Interesting idea. That would be a really cool feature. Maybe we can even combine it with download speed predictions. The main problem I see is potential concurrency. Potentially all dependencies can be built in parallel, then summing up their build times is a gross over approximation.

maralorn avatar Sep 13 '22 16:09 maralorn

True, I had not thought of that. For usage as a lower bound, it is correct to just divide by max-jobs (output by nix show-config) Another possibility since you have the dependency graph is to just compute one (out of the many possible) scheduling and use that as an estimate.

symphorien avatar Sep 13 '22 17:09 symphorien

Well, I guess the most awesome thing to do would be to calculate the estimated duration for every dependency chain. So when a node has multiple dependencies, we always take the maximum of the estimated wait time for all their direct children as the estimate.

This will require a bit of a refactoring, since currently we only look up estimated times from the database once a build starts, but yeah, this would be very cool. It might also help with sorting the build tree smarter.

maralorn avatar Sep 13 '22 22:09 maralorn