summaryrefslogtreecommitdiffstats
path: root/tests/functest/odl-sfc/utils.py
diff options
context:
space:
mode:
authorManuel Buil <manuelbuil87@gmail.com>2016-12-14 09:01:51 +0000
committerGerrit Code Review <gerrit@opnfv.org>2016-12-14 09:01:51 +0000
commit1350624dbcf49c27ae0333719c2d7dda86ca7b0e (patch)
tree5ae1150ced3b89271fb4a96924f5eda696f6654b /tests/functest/odl-sfc/utils.py
parent5ede992279f3e9f1dd1104d9d5aa557139f01fcf (diff)
parentcac0708ccc9677e9a9a9066b2fc8b56f84af95cf (diff)
Merge "Use timethis from functest utils"
Diffstat (limited to 'tests/functest/odl-sfc/utils.py')
-rw-r--r--tests/functest/odl-sfc/utils.py17
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 ''