From ae7be0e0490495d869881e2e95b4a549e2cfdce3 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 26 Sep 2011 20:35:59 +0000 Subject: [PATCH] better output of the transferListener for remote index download git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1176041 13f79535-47bb-0310-9956-ffa450edef68 --- .../indexing/DownloadRemoteIndexTask.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java index c4b3e3511..5e8bc5d8f 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java @@ -271,14 +271,21 @@ public class DownloadRemoteIndexTask { private Logger log = LoggerFactory.getLogger( getClass() ); + String reourceName; + + long startTime; + public void transferInitiated( TransferEvent transferEvent ) { - log.debug( "initiate transfer of {}", transferEvent.getResource().getName() ); + reourceName = transferEvent.getResource().getName(); + log.debug( "initiate transfer of {}", reourceName ); } public void transferStarted( TransferEvent transferEvent ) { - log.debug( "start transfer of {}", transferEvent.getResource().getName() ); + reourceName = transferEvent.getResource().getName(); + startTime = System.currentTimeMillis(); + log.info( "start transfer of {}", transferEvent.getResource().getName() ); } public void transferProgress( TransferEvent transferEvent, byte[] buffer, int length ) @@ -289,7 +296,10 @@ public class DownloadRemoteIndexTask public void transferCompleted( TransferEvent transferEvent ) { - log.info( "end of transfer file " + transferEvent.getResource().getName() ); + reourceName = transferEvent.getResource().getName(); + long endTime = System.currentTimeMillis(); + log.info( "end of transfer file {}: {}s", transferEvent.getResource().getName(), + ( endTime - startTime ) / 1000 ); } public void transferError( TransferEvent transferEvent )