Log total execution time to info
This commit is contained in:
parent
a83d6de253
commit
e4212f28fb
|
@ -3,7 +3,9 @@
|
||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
import logging
|
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 import config
|
||||||
from tsstats.exceptions import InvalidConfiguration
|
from tsstats.exceptions import InvalidConfiguration
|
||||||
|
@ -72,6 +74,7 @@ def cli():
|
||||||
|
|
||||||
|
|
||||||
def main(configuration):
|
def main(configuration):
|
||||||
|
start_time = time()
|
||||||
# setup logging
|
# setup logging
|
||||||
if configuration.getboolean('General', 'debug'):
|
if configuration.getboolean('General', 'debug'):
|
||||||
logger.setLevel(logging.DEBUG)
|
logger.setLevel(logging.DEBUG)
|
||||||
|
@ -113,6 +116,7 @@ def main(configuration):
|
||||||
onlinetime_threshold=int(configuration.get(
|
onlinetime_threshold=int(configuration.get(
|
||||||
'General', 'onlinetimethreshold'))
|
'General', 'onlinetimethreshold'))
|
||||||
)
|
)
|
||||||
|
logger.info('Finished after %s seconds', time() - start_time)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue