Adds log information about candidate harvest time for each harvester.

This commit is contained in:
chenzo 2012-07-11 16:33:03 +00:00
parent bdce4653bd
commit 6d42555340
2 changed files with 36 additions and 0 deletions

View File

@ -105,6 +105,7 @@ public class CandidateHarvesterSet
final Component component,
ExecutorService executorService)
{
long startCandidateHarvestTime = System.currentTimeMillis();
/**
* Represents a task to be executed by the specified executorService and
@ -276,6 +277,15 @@ public class CandidateHarvesterSet
}
taskIter.remove();
}
long stopCandidateHarvestTime = System.currentTimeMillis();
long candidateHarvestTime
= stopCandidateHarvestTime - startCandidateHarvestTime;
logger.info(
"End candidate harvest for all harvesters within "
+ candidateHarvestTime + " ms"
+ ", component:\n\t"
+ component);
}
/**
@ -405,9 +415,22 @@ public class CandidateHarvesterSet
{
if (isEnabled())
{
long startCandidateHarvestTime = System.currentTimeMillis();
Collection<LocalCandidate> candidates
= harvester.harvest(component);
long stopCandidateHarvestTime = System.currentTimeMillis();
long candidateHarvestTime
= stopCandidateHarvestTime - startCandidateHarvestTime;
logger.info(
"End candidate harvest within "
+ candidateHarvestTime
+ " ms, for "
+ harvester.getClass().getName()
+ ", component:\n\t"
+ component);
/*
* If the CandidateHarvester has not gathered any candidates, it
* is considered failed and will not be used again in order to

View File

@ -64,6 +64,8 @@ public class HostCandidateHarvester
throws IllegalArgumentException,
IOException
{
long startCandidateHarvestTime = System.currentTimeMillis();
Enumeration<NetworkInterface> interfaces
= NetworkInterface.getNetworkInterfaces();
@ -169,6 +171,17 @@ public class HostCandidateHarvester
+ " minPort=" + minPort
+ " maxPort=" + maxPort);
}
long stopCandidateHarvestTime = System.currentTimeMillis();
long candidateHarvestTime
= stopCandidateHarvestTime - startCandidateHarvestTime;
logger.info(
"End candidate harvest within "
+ candidateHarvestTime
+ " ms, for "
+ this.getClass().getName()
+ ", component:\n\t"
+ component);
}
/**