From 8fb115fe2c6292387a87eaaa4f28b12c062f6850 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 16 Jan 2012 12:39:20 -0800 Subject: [PATCH] include run duration in summary.yaml --- teuthology/run.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/teuthology/run.py b/teuthology/run.py index 13ec63165a..815e73d444 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -69,6 +69,7 @@ def main(): from gevent import monkey; monkey.patch_all() from .orchestra import monkey; monkey.patch_all() + import time import logging log = logging.getLogger(__name__) @@ -144,10 +145,16 @@ def main(): ctx.config['tasks'][:0] = init_tasks + start_time = time.time() + from teuthology.run_tasks import run_tasks try: run_tasks(tasks=ctx.config['tasks'], ctx=ctx) finally: + end_time = time.time() + duration = end_time - start_time + ctx.summary['duration'] = duration + log.info("Duration was %f seconds" % duration) if not ctx.summary.get('success') and ctx.config.get('nuke-on-error'): from teuthology.parallel import parallel with parallel() as p: -- 2.39.5