]> source.dussan.org Git - archiva.git/commitdiff
log time to merge indexes
authorOlivier Lamy <olamy@apache.org>
Thu, 7 Feb 2013 22:22:13 +0000 (22:22 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 7 Feb 2013 22:22:13 +0000 (22:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1443760 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java

index aaee1e576ee09a1feb167396a87a19005c8f66e5..8ed8205c3e0f81e1488b2339a0fc766ea8b2f219 100644 (file)
@@ -25,6 +25,7 @@ import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
 import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.math.NumberUtils;
+import org.apache.commons.lang.time.StopWatch;
 import org.apache.maven.index.NexusIndexer;
 import org.apache.maven.index.context.IndexingContext;
 import org.apache.maven.index.context.UnsupportedExistingLuceneIndexException;
@@ -90,6 +91,9 @@ public class DefaultIndexMerger
     public IndexingContext buildMergedIndex( IndexMergerRequest indexMergerRequest )
         throws IndexMergerException
     {
+        StopWatch stopWatch = new StopWatch();
+        stopWatch.reset();
+        stopWatch.start();
         File tempRepoFile = Files.createTempDir();
         tempRepoFile.deleteOnExit();
 
@@ -120,6 +124,8 @@ public class DefaultIndexMerger
             }
             temporaryGroupIndexes.add(
                 new TemporaryGroupIndex( tempRepoFile, tempRepoId, indexMergerRequest.getGroupId() ) );
+            stopWatch.stop();
+            log.info( "merged index for repos {} in {} s", indexMergerRequest.getRepositoriesIds(), stopWatch.getTime() );
             return indexingContext;
         }
         catch ( IOException e )