diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2023-07-14 16:38:58 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2023-07-14 16:38:58 -0400 |
commit | 44a0ace096e83847ab7de36d6607d1f0037b06ec (patch) | |
tree | e15b9e59283ef2f1de60b5d490fe769fa9b1e519 | |
parent | 692bcf79512ee1fe5f78f4d61cac45588d79b9bf (diff) | |
download | bugspray-44a0ace096e83847ab7de36d6607d1f0037b06ec.tar.gz |
Report elapsed time during cron runs
Give a simple report how long it took to run full cron.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | peebz/command.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/peebz/command.py b/peebz/command.py index a7cb2f7..7b6dc16 100644 --- a/peebz/command.py +++ b/peebz/command.py @@ -6,6 +6,8 @@ import sys import argparse +import time + import b4 import logging import logging.handlers @@ -35,12 +37,16 @@ def cmd_git2bz(cmdargs): def cmd_cron(cmdargs): + cstart = int(time.time()) + logger.info('--- Start cron ---') logger.info('--- Running bz2pi ---') cmd_bz2pi(cmdargs) logger.info('--- Running pi2bz ---') cmd_pi2bz(cmdargs) logger.info('--- Running git2bz ---') cmd_git2bz(cmdargs) + celapsed = int(time.time()) - cstart + logger.info('--- End cron (elapsed: %s s) ---', celapsed) def cmd_bzdump(cmdargs): |