From e4212f28fb3681acfcdcc1c4d9102e9a765ccac1 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Fri, 24 Mar 2017 23:17:58 +0100 Subject: [PATCH] Log total execution time to info --- tsstats/__main__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tsstats/__main__.py b/tsstats/__main__.py index 3bb6455..8ae57e4 100644 --- a/tsstats/__main__.py +++ b/tsstats/__main__.py @@ -3,7 +3,9 @@ import argparse import json import logging -from os.path import abspath, exists, isdir, join as pathjoin +from os.path import join as pathjoin +from os.path import abspath, exists, isdir +from time import time from tsstats import config from tsstats.exceptions import InvalidConfiguration @@ -72,6 +74,7 @@ def cli(): def main(configuration): + start_time = time() # setup logging if configuration.getboolean('General', 'debug'): logger.setLevel(logging.DEBUG) @@ -113,6 +116,7 @@ def main(configuration): onlinetime_threshold=int(configuration.get( 'General', 'onlinetimethreshold')) ) + logger.info('Finished after %s seconds', time() - start_time) if __name__ == '__main__':