blob: 01718e351b8ab2bbf3ddb290e447e3771621e043 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
|