diff options
author | Tibor Frank <tifrank@cisco.com> | 2019-01-14 13:31:45 +0100 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2019-01-21 14:13:45 +0100 |
commit | 339d55392405b435fea92f62c3372b7940c46515 (patch) | |
tree | 6cfe3261cdcdcc7abdbe101c8eb27fd51fa68831 /resources/tools/presentation/input_data_parser.py | |
parent | bec963c7d97302d7a0e41d38a5eec1ff5e518067 (diff) |
Bar graph for Soak tests results
CSIT-1401: Create bar graph for Soak tests results
CSIT-1405: Add data pre-processing for "soak tests" graphs
Change-Id: I158c54e713cb904eb1780190153413929c7bab6d
Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/presentation/input_data_parser.py')
-rw-r--r-- | resources/tools/presentation/input_data_parser.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/resources/tools/presentation/input_data_parser.py b/resources/tools/presentation/input_data_parser.py index 5e4ca42de4..7b36352ed9 100644 --- a/resources/tools/presentation/input_data_parser.py +++ b/resources/tools/presentation/input_data_parser.py @@ -252,6 +252,9 @@ class ExecutionChecker(ResultVisitor): # TODO: Remove when definitely no NDRPDRDISC tests are used: REGEX_RATE = re.compile(r'^[\D\d]*FINAL_RATE:\s(\d+\.\d+)\s(\w+)') + REGEX_PLR_RATE = re.compile(r'PLRsearch lower bound::\s(\d+.\d+).*\n' + r'PLRsearch upper bound::\s(\d+.\d+)') + REGEX_NDRPDR_RATE = re.compile(r'NDR_LOWER:\s(\d+.\d+).*\n.*\n' r'NDR_UPPER:\s(\d+.\d+).*\n' r'PDR_LOWER:\s(\d+.\d+).*\n.*\n' @@ -567,6 +570,33 @@ class ExecutionChecker(ResultVisitor): return throughput, status + def _get_plr_throughput(self, msg): + """Get PLRsearch lower bound and PLRsearch upper bound from the test + message. + + :param msg: The test message to be parsed. + :type msg: str + :returns: Parsed data as a dict and the status (PASS/FAIL). + :rtype: tuple(dict, str) + """ + + throughput = { + "LOWER": -1.0, + "UPPER": -1.0 + } + status = "FAIL" + groups = re.search(self.REGEX_PLR_RATE, msg) + + if groups is not None: + try: + throughput["LOWER"] = float(groups.group(1)) + throughput["UPPER"] = float(groups.group(2)) + status = "PASS" + except (IndexError, ValueError): + pass + + return throughput, status + def _get_ndrpdr_latency(self, msg): """Get LATENCY from the test message. @@ -739,6 +769,7 @@ class ExecutionChecker(ResultVisitor): if test.status == "PASS" and ("NDRPDRDISC" in tags or "NDRPDR" in tags or + "SOAK" in tags or "TCP" in tags or "MRR" in tags or "BMRR" in tags): @@ -750,6 +781,8 @@ class ExecutionChecker(ResultVisitor): test_result["type"] = "PDR" elif "NDRPDR" in tags: test_result["type"] = "NDRPDR" + elif "SOAK" in tags: + test_result["type"] = "SOAK" elif "TCP" in tags: test_result["type"] = "TCP" elif "MRR" in tags: @@ -790,6 +823,10 @@ class ExecutionChecker(ResultVisitor): test_result["latency"], test_result["status"] = \ self._get_ndrpdr_latency(test.message) + elif test_result["type"] in ("SOAK", ): + test_result["throughput"], test_result["status"] = \ + self._get_plr_throughput(test.message) + elif test_result["type"] in ("TCP", ): groups = re.search(self.REGEX_TCP, test.message) test_result["result"] = int(groups.group(2)) |