Author: ogusakov
Date: Tue Sep 30 12:26:37 2008
New Revision: 700559

URL: http://svn.apache.org/viewvc?rev=700559&view=rev
Log:
added network profiling - http://jira.codehaus.org/browse/MARTIFACT-23

Modified:
    
maven/sandbox/trunk/wagon/wagon-mercury/src/main/java/org/apache/maven/wagon/mercury/MercuryWagon.java

Modified: 
maven/sandbox/trunk/wagon/wagon-mercury/src/main/java/org/apache/maven/wagon/mercury/MercuryWagon.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/wagon/wagon-mercury/src/main/java/org/apache/maven/wagon/mercury/MercuryWagon.java?rev=700559&r1=700558&r2=700559&view=diff
==============================================================================
--- 
maven/sandbox/trunk/wagon/wagon-mercury/src/main/java/org/apache/maven/wagon/mercury/MercuryWagon.java
 (original)
+++ 
maven/sandbox/trunk/wagon/wagon-mercury/src/main/java/org/apache/maven/wagon/mercury/MercuryWagon.java
 Tue Sep 30 12:26:37 2008
@@ -197,6 +197,8 @@
     
     pushEvent( new TransferEvent(this, resource, 
TransferEvent.TRANSFER_PROGRESS, TransferEvent.REQUEST_GET) );
     
+    long start = System.currentTimeMillis();
+    
     RetrievalResponse response = retriever.retrieve( request );
     
     fireGetCompleted( resource, destination );
@@ -208,7 +210,7 @@
     }
 
     if( _log.isDebugEnabled() )
-      _log.debug("MercuryWagon got "+resourceName+" into "+destination);
+      _log.debug("MercuryWagon got ["+resourceName+" ==> "+destination + "], 
time " + (System.currentTimeMillis()-start) + " millis");
     
   }
 
@@ -254,6 +256,8 @@
     server.setUserAgent( userAgent );
 
     pushEvent( new TransferEvent(this, resource, 
TransferEvent.TRANSFER_PROGRESS, TransferEvent.REQUEST_PUT) );
+    
+    long start = System.currentTimeMillis();
 
     DeployResponse response = deployer.deploy( request );
 
@@ -263,6 +267,9 @@
     {
       throw new TransferFailedException( response.getExceptions().toString() );
     }
+
+    if( _log.isDebugEnabled() )
+      _log.debug("MercuryWagon put ["+source+" ==> "+destination + "], time " 
+ (System.currentTimeMillis()-start) + " millis");
   }
 
   protected void closeConnection()


Reply via email to