diff options
author | Vratko Polak <vrpolak@cisco.com> | 2019-12-02 19:01:35 +0100 |
---|---|---|
committer | Vratko Polak <vrpolak@cisco.com> | 2019-12-02 19:01:35 +0100 |
commit | bd799a13a06c82e9b38097ea80ec30337edd5e8e (patch) | |
tree | a07e553c33e73a8fa28849bd8fdbbe018a8a0868 /resources/tools/presentation/input_data_parser.py | |
parent | 627cddca1d64edb8475407a1524efb2a22249a25 (diff) |
Use Jumpavg 0.2.0 in PAL
+ As a side effect, PAL is now part of "resource" package tree.
- Testable only with 23558 (the rest of PAL Python 3 migration).
Change-Id: Icbd90fd71458c07bced86f4bab9fa4e68282c38c
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources/tools/presentation/input_data_parser.py')
-rw-r--r-- | resources/tools/presentation/input_data_parser.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/resources/tools/presentation/input_data_parser.py b/resources/tools/presentation/input_data_parser.py index 46c8b9d5b9..e48b271489 100644 --- a/resources/tools/presentation/input_data_parser.py +++ b/resources/tools/presentation/input_data_parser.py @@ -34,8 +34,8 @@ from os import remove from datetime import datetime as dt from datetime import timedelta from json import loads -from jumpavg.AvgStdevMetadataFactory import AvgStdevMetadataFactory +from resources.libraries.python import jumpavg from input_data_files import download_and_unzip_data_file @@ -147,7 +147,9 @@ class ExecutionChecker(ResultVisitor): "type": "MRR" | "BMRR", "status": "PASS" | "FAIL", "result": { - "receive-rate": AvgStdevMetadata, + "receive-rate": float, + # Average of a list, computed using AvgStdevStats. + # In CSIT-1180, replace with List[float]. } } @@ -832,17 +834,13 @@ class ExecutionChecker(ResultVisitor): items_str = groups.group(1) items_float = [float(item.strip()) for item in items_str.split(",")] - metadata = AvgStdevMetadataFactory.from_data(items_float) - # Next two lines have been introduced in CSIT-1179, - # to be removed in CSIT-1180. - metadata.size = 1 - metadata.stdev = 0.0 - test_result["result"]["receive-rate"] = metadata + # Use whole list in CSIT-1180. + stats = jumpavg.AvgStdevStats.for_runs(items_float) + test_result["result"]["receive-rate"] = stats.avg else: groups = re.search(self.REGEX_MRR, test.message) test_result["result"]["receive-rate"] = \ - AvgStdevMetadataFactory.from_data([ - float(groups.group(3)) / float(groups.group(1)), ]) + float(groups.group(3)) / float(groups.group(1)) elif test_result["type"] == "RECONF": test_result["result"] = None |