From: Thanh Ha Date: Mon, 26 Nov 2018 02:58:08 +0000 (+0800) Subject: Print the time in seconds it took to upload X-Git-Tag: v0.19.0~2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=ebba29583eda773649c6ff4de89d4cbce7c93a80;p=releng%2Flftools.git Print the time in seconds it took to upload Issue: RELENG-1512 Change-Id: I53760367a57ab28f1afc29418cc45db60773e5b9 Signed-off-by: Thanh Ha --- 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)