overhead should include the time we spent waiting for the completion of asynchronous tasks

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6631 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2008-01-13 21:07:07 +00:00
1 parent 43683fcf43
commit 6f5c1c1bfa
1 file changed
+3 -1
@@ -130,6 +130,7 @@ public abstract class MavenBuilder implements DelegatingCallable<Result,IOExcept
// now check the completion status of async ops
boolean messageReported = false;
long startTime = System.nanoTime();
for (Future<?> f : futures) {
try {
if(!f.isDone() && !messageReported) {
@@ -147,12 +148,13 @@ public abstract class MavenBuilder implements DelegatingCallable<Result,IOExcept
e.printStackTrace(listener.error("Asynchronous execution failure"));
}
}
a.overheadTime += System.nanoTime()-startTime;
futures.clear();
if(profile) {
NumberFormat n = NumberFormat.getInstance();
PrintStream logger = listener.getLogger();
logger.println("Total over head was "+format(n,a.overheadTime)+"ms");
logger.println("Total overhead was "+format(n,a.overheadTime)+"ms");
Channel ch = Channel.current();
logger.println("Class loading " +format(n,ch.classLoadingTime.get()) +"ms, "+ch.classLoadingCount+" classes");
logger.println("Resource loading "+format(n,ch.resourceLoadingTime.get())+"ms, "+ch.resourceLoadingCount+" times");