Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 14897 - A script that times compiles, could be stored in /var/db/pkg, and used for gentoo-stats.
Summary: A script that times compiles, could be stored in /var/db/pkg, and used for ge...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-01 01:25 UTC by Joseph Burkett
Modified: 2011-10-30 22:37 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Burkett 2003-02-01 01:25:23 UTC
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";
}
Comment 1 SpanKY gentoo-dev 2003-02-01 03:53:22 UTC
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 ;)
Comment 2 Adrian 2003-06-06 14:29:44 UTC
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.

Comment 3 Marius Mauch (RETIRED) gentoo-dev 2004-02-04 19:42:30 UTC
emerge app-portage/splat or app-portage/genlop