I often hear people come in the room and ask, "How long is it gonna take to compile program n?". So I thought of a way to time compiles. The problem would be you'd actually have to pass the program through the script. Unless, you could catch on to maybe a pid somehow or something similar. I don't know the working internals of portage. So, someone might have a better idea. It's about a 6 line perl script. No big deal. Can be ported to python easily. It could store the stats in /var/db/pkg so people could have the timing on their compiles. Or even, perhaps with the gentoo-stats database. It could show maybe the architecture, cpu, memory, flags, etc, And how long it took to compile. So people would have a very good idea, how long it's gonna take on their hardware. Reproducible: Always Steps to Reproduce: 1. 2. 3. The script is as follows: #!/usr/bin/perl $program = shift; $start = time(); system("$program"); $end = time(); if($end - $start > 1) { print "Program started: ", scalar localtime($start), "\n"; print "Program ended: ", scalar localtime($end), "\n"; }
why not just run `time emerge <pkg>` rather than doing all of that ? people are concerened really with the total time to emerge rather than just to compile something ... also, these values are really only valid for a box that isnt doing anything *but* running emerge ... we've discussed many ways of how to track the total process of an emerge ... i'm a big fan of fam + imon ;)
How about borrowing the idea from LinuxFromScratch: http://www.linuxfromscratch.org/view/4.1/chapter02/aboutsbus.html Pick a base package and make that the baseline that everything else is compared against. It would be nice braincandy to know upfront that "emerge -u portage" is going to take such-and-such many hrs on this particular machine.
emerge app-portage/splat or app-portage/genlop