From ebba29583eda773649c6ff4de89d4cbce7c93a80 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Mon, 26 Nov 2018 10:58:08 +0800 Subject: [PATCH] Print the time in seconds it took to upload Issue: RELENG-1512 Change-Id: I53760367a57ab28f1afc29418cc45db60773e5b9 Signed-off-by: Thanh Ha --- lftools/deploy.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lftools/deploy.py b/lftools/deploy.py index afbda0a2..7b116e2d 100644 --- a/lftools/deploy.py +++ b/lftools/deploy.py @@ -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) -- 2.16.6