You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2013/04/21 15:27:25 UTC

svn commit: r1470297 - in /lucene/dev/branches/branch_4x: ./ dev-tools/ dev-tools/scripts/smokeTestRelease.py

Author: mikemccand
Date: Sun Apr 21 13:27:25 2013
New Revision: 1470297

URL: http://svn.apache.org/r1470297
Log:
print time taken in some steps plus total time

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/dev-tools/   (props changed)
    lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py

Modified: lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py?rev=1470297&r1=1470296&r2=1470297&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py (original)
+++ lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py Sun Apr 21 13:27:25 2013
@@ -19,6 +19,8 @@ import tarfile
 import zipfile
 import threading
 import traceback
+import datetime
+import time
 import subprocess
 import signal
 import shutil
@@ -134,6 +136,7 @@ def getHREFs(urlString):
   return links
 
 def download(name, urlString, tmpDir, quiet=False):
+  startTime = time.time()
   fileName = '%s/%s' % (tmpDir, name)
   if not FORCE_CLEAN and os.path.exists(fileName):
     if not quiet and fileName.find('.asc') == -1:
@@ -158,7 +161,9 @@ def download(name, urlString, tmpDir, qu
       if not success:
         os.remove(fileName)
     if not quiet and fileName.find('.asc') == -1:
-      print('    %.1f MB' % (os.path.getsize(fileName)/1024./1024.))
+      t = time.time()-startTime
+      sizeMB = os.path.getsize(fileName)/1024./1024.
+      print('    %.1f MB in %.2f sec (%.1f MB/sec)' % (sizeMB, t, sizeMB/t))
   except Exception as e:
     raise RuntimeError('failed to download url "%s"' % urlString) from e
   
@@ -1337,6 +1342,8 @@ def main():
 
 def smokeTest(baseURL, version, tmpDir, isSigned):
 
+  startTime = datetime.datetime.now()
+  
   if FORCE_CLEAN:
     if os.path.exists(tmpDir):
       raise RuntimeError('temp dir %s exists; please remove first' % tmpDir)
@@ -1382,7 +1389,7 @@ def smokeTest(baseURL, version, tmpDir, 
   print('Test Maven artifacts for Lucene and Solr...')
   checkMaven(baseURL, tmpDir, version, isSigned)
 
-  print('\nSUCCESS!\n')
+  print('\nSUCCESS! [%s]\n' % (datetime.datetime.now() - startTime))
 
 if __name__ == '__main__':
   print('NOTE: output encoding is %s' % sys.stdout.encoding)