diff --git a/src/org/ice4j/ice/harvest/CandidateHarvesterSet.java b/src/org/ice4j/ice/harvest/CandidateHarvesterSet.java index 8ec388e..2b21f9a 100644 --- a/src/org/ice4j/ice/harvest/CandidateHarvesterSet.java +++ b/src/org/ice4j/ice/harvest/CandidateHarvesterSet.java @@ -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 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 diff --git a/src/org/ice4j/ice/harvest/HostCandidateHarvester.java b/src/org/ice4j/ice/harvest/HostCandidateHarvester.java index 6e8ee7d..eaa00ba 100644 --- a/src/org/ice4j/ice/harvest/HostCandidateHarvester.java +++ b/src/org/ice4j/ice/harvest/HostCandidateHarvester.java @@ -64,6 +64,8 @@ public class HostCandidateHarvester throws IllegalArgumentException, IOException { + long startCandidateHarvestTime = System.currentTimeMillis(); + Enumeration 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); } /**