summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base/archiva-repository-scanner
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-03-12 22:25:13 +0000
committerOlivier Lamy <olamy@apache.org>2012-03-12 22:25:13 +0000
commit15549c85b0a02b4cf1aa9d51a07e72a500c6a3d4 (patch)
tree790092e339ad84b3068a7cb3d8937f3704eaeedd /archiva-modules/archiva-base/archiva-repository-scanner
parentb1dd384a7d61cb8d3aca510e772d4296f35b482e (diff)
downloadarchiva-15549c85b0a02b4cf1aa9d51a07e72a500c6a3d4.tar.gz
archiva-15549c85b0a02b4cf1aa9d51a07e72a500c6a3d4.zip
[MRM-1580] system status page current scanner stats.
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1299905 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-repository-scanner')
-rw-r--r--archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScannerInstance.java29
1 files changed, 16 insertions, 13 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScannerInstance.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScannerInstance.java
index 059d6b528..80a6fb730 100644
--- a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScannerInstance.java
+++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScannerInstance.java
@@ -20,6 +20,10 @@ package org.apache.archiva.repository.scanner;
*/
import org.apache.archiva.admin.model.beans.ManagedRepository;
+import org.apache.archiva.common.utils.BaseFile;
+import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
+import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
+import org.apache.archiva.consumers.functors.ConsumerWantsFilePredicate;
import org.apache.archiva.repository.scanner.functors.ConsumerProcessFileClosure;
import org.apache.archiva.repository.scanner.functors.TriggerBeginScanClosure;
import org.apache.archiva.repository.scanner.functors.TriggerScanCompletedClosure;
@@ -27,10 +31,6 @@ import org.apache.commons.collections.Closure;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.functors.IfClosure;
import org.apache.commons.lang.SystemUtils;
-import org.apache.archiva.common.utils.BaseFile;
-import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
-import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
-import org.apache.archiva.consumers.functors.ConsumerWantsFilePredicate;
import org.codehaus.plexus.util.DirectoryWalkListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -40,8 +40,9 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+
/**
- * RepositoryScannerInstance
+ * RepositoryScannerInstance
*
* @version $Id$
*/
@@ -49,7 +50,7 @@ public class RepositoryScannerInstance
implements DirectoryWalkListener
{
private Logger log = LoggerFactory.getLogger( RepositoryScannerInstance.class );
-
+
/**
* Consumers that process known content.
*/
@@ -82,8 +83,8 @@ public class RepositoryScannerInstance
this.knownConsumers = knownConsumerList;
this.invalidConsumers = invalidConsumerList;
- consumerTimings = new HashMap<String,Long>();
- consumerCounts = new HashMap<String,Long>();
+ consumerTimings = new HashMap<String, Long>();
+ consumerCounts = new HashMap<String, Long>();
this.consumerProcessFile = new ConsumerProcessFileClosure();
consumerProcessFile.setExecuteOnEntireRepo( true );
@@ -95,7 +96,8 @@ public class RepositoryScannerInstance
stats = new RepositoryScanStatistics();
stats.setRepositoryId( repository.getId() );
- Closure triggerBeginScan = new TriggerBeginScanClosure( repository, new Date( System.currentTimeMillis() ), true );
+ Closure triggerBeginScan =
+ new TriggerBeginScanClosure( repository, new Date( System.currentTimeMillis() ), true );
CollectionUtils.forAllDo( knownConsumerList, triggerBeginScan );
CollectionUtils.forAllDo( invalidConsumerList, triggerBeginScan );
@@ -108,7 +110,8 @@ public class RepositoryScannerInstance
public RepositoryScannerInstance( ManagedRepository repository,
List<KnownRepositoryContentConsumer> knownContentConsumers,
- List<InvalidRepositoryContentConsumer> invalidContentConsumers, long changesSince )
+ List<InvalidRepositoryContentConsumer> invalidContentConsumers,
+ long changesSince )
{
this( repository, knownContentConsumers, invalidContentConsumers );
@@ -134,7 +137,7 @@ public class RepositoryScannerInstance
public void directoryWalkStarting( File basedir )
{
- log.info( "Walk Started: [" + this.repository.getId() + "] " + this.repository.getLocation() );
+ log.info( "Walk Started: [{}] {}", this.repository.getId(), this.repository.getLocation() );
stats.triggerStart();
}
@@ -175,7 +178,7 @@ public class RepositoryScannerInstance
stats.setConsumerTimings( consumerTimings );
stats.setConsumerCounts( consumerCounts );
- log.info( "Walk Finished: [" + this.repository.getId() + "] " + this.repository.getLocation() );
+ log.info( "Walk Finished: [{}] {}", this.repository.getId(), this.repository.getLocation() );
stats.triggerFinished();
}
@@ -186,7 +189,7 @@ public class RepositoryScannerInstance
{
log.debug( "Repository Scanner: {}", message );
}
-
+
public ManagedRepository getRepository()
{
return repository;