diff options
author | Joanna Jeremicz <joanna.jeremicz@nokia.com> | 2021-02-16 09:34:13 +0100 |
---|---|---|
committer | Joanna Jeremicz <joanna.jeremicz@nokia.com> | 2021-03-02 07:59:49 +0100 |
commit | 59bad158d7dd96c157fb9387db2de8ecb9214914 (patch) | |
tree | 66fbb51f482b7b762f27ae55995f6c1413c3222e /tests/dcaegen2-pmmapper/files-processing-config-pmmapper/libraries/LogReader.py | |
parent | 5576a927ee2999f6bfa48219941c5c16693a9967 (diff) |
Add CSITs for Pm-mapper files processing performance
Issue-ID: DCAEGEN2-2600
Signed-off-by: Joanna Jeremicz <joanna.jeremicz@nokia.com>
Signed-off-by: Tomasz Wrobel <tomasz.wrobel@nokia.com>
Change-Id: Id7e4d345380fd5fd08f28a3ddff04a4fde8f7730
Diffstat (limited to 'tests/dcaegen2-pmmapper/files-processing-config-pmmapper/libraries/LogReader.py')
-rw-r--r-- | tests/dcaegen2-pmmapper/files-processing-config-pmmapper/libraries/LogReader.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/libraries/LogReader.py b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/libraries/LogReader.py new file mode 100644 index 00000000..01718e35 --- /dev/null +++ b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/libraries/LogReader.py @@ -0,0 +1,22 @@ +import re + +class LogReader: + + def filter_unique(self, merged_logs_output, testname): + logs = merged_logs_output.splitlines() + del_logs = list(filter(lambda line: "|DEL|" in line, logs)) + nrs_set = set() + ret_logs = set() + for log in del_logs: + filename = re.findall(testname + "\d", log) + if len(filename) > 0 and filename[0] not in nrs_set: + ret_logs.add(log) + nrs_set.add(filename[0]) + return ret_logs + + def get_number_of_dropped_messages(self, logs_output): + return len(list(filter(lambda line: "|429|" in line, logs_output))) + + def get_log_files_list(self, fileNames): + files = fileNames.split() + return files |