Print the time in seconds it took to upload 53/13653/2
authorThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 26 Nov 2018 02:58:08 +0000 (10:58 +0800)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 26 Nov 2018 03:21:12 +0000 (11:21 +0800)
Issue: RELENG-1512
Change-Id: I53760367a57ab28f1afc29418cc45db60773e5b9
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
lftools/deploy.py

index afbda0a..7b116e2 100644 (file)
@@ -10,6 +10,7 @@
 ##############################################################################
 """Library of functions for deploying artifacts to Nexus."""
 
+from datetime import timedelta
 import errno
 import gzip
 import logging
@@ -21,6 +22,7 @@ import shutil
 import subprocess
 import sys
 import tempfile
+import time
 import zipfile
 
 from defusedxml.minidom import parseString
@@ -539,10 +541,13 @@ def deploy_nexus(nexus_repo_url, deploy_dir, snapshot=False):
                         file_list.append(file)
 
     # Perform parallel upload
+    upload_start = time.time()
     pool = ThreadPool(multiprocessing.cpu_count())
     pool.map(_deploy_nexus_upload, file_list)
     pool.close()
     pool.join()
+    upload_time = time.time() - upload_start
+    log.info("Uploaded in {} seconds.".format(timedelta(seconds=round(upload_time))))
 
     os.chdir(previous_dir)