from gevent import monkey; monkey.patch_all()
from .orchestra import monkey; monkey.patch_all()
- import time
import logging
log = logging.getLogger(__name__)
{'internal.archive': None},
{'internal.coredump': None},
{'internal.syslog': None},
+ {'internal.timer': None},
])
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:
owner=ctx.owner,
)
+@contextlib.contextmanager
+def timer(ctx, config):
+ log.info('Starting timer...')
+ start = time.time()
+ try:
+ yield
+ finally:
+ duration = time.time() - start
+ log.info('Duration was %f seconds', duration)
+ ctx.summary['duration'] = duration
+
def connect(ctx, config):
log.info('Opening connections...')
from ..orchestra import connection, remote