diff options
author | George Paraskevopoulos <geopar@intracom-telecom.com> | 2016-12-13 15:50:25 +0200 |
---|---|---|
committer | George Paraskevopoulos <geopar@intracom-telecom.com> | 2016-12-14 10:13:52 +0200 |
commit | cac0708ccc9677e9a9a9066b2fc8b56f84af95cf (patch) | |
tree | 6603e277785d1d8e83e3f4a15abb9ea72304d52e /tests/functest/odl-sfc | |
parent | b7db5146456f580e8596ef47cf7aee8e0ac18598 (diff) |
Use timethis from functest utils
timethis is hosted now in the functest code. Use that and delete the
local function
Change-Id: Icfdfa0609cd5ac93e6852e77e09bc4b901894f18
Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
Diffstat (limited to 'tests/functest/odl-sfc')
-rw-r--r-- | tests/functest/odl-sfc/utils.py | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/tests/functest/odl-sfc/utils.py b/tests/functest/odl-sfc/utils.py index 4bff0a77..b4e40622 100644 --- a/tests/functest/odl-sfc/utils.py +++ b/tests/functest/odl-sfc/utils.py @@ -7,7 +7,6 @@ import functest.utils.openstack_utils as os_utils import re import json import opnfv.utils.SSHUtils as ssh_utils -import functools logger = ft_logger.Logger("sfc_test_utils").getLogger() @@ -341,20 +340,6 @@ def check_ssh(ips, retries=100): return False -def timethis(func): - """Measure the time it takes to update the classification rules""" - @functools.wraps(func) - def timed(*args, **kwargs): - ts = time.time() - result = func(*args, **kwargs) - te = time.time() - elapsed = '{0}'.format(te - ts) - logger.info('{f}(*{a}, **{kw}) took: {t} sec'.format( - f=func.__name__, a=args, kw=kwargs, t=elapsed)) - return result - return timed - - def ofctl_time_counter(ovs_logger, ssh_conn): try: # We get the flows from table 11 @@ -375,7 +360,7 @@ def ofctl_time_counter(ovs_logger, ssh_conn): return None -@timethis +@ft_utils.timethis def capture_time_log(ovs_logger, compute_clients, timeout=200): rsps = ofctl_time_counter(ovs_logger, compute_clients[0]) first_RSP = rsps[0] if len(rsps) > 0 else '' |