Commit ead9c1e0 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Adds plot_exec_log in test

Showing with 9 additions and 6 deletions
+9 -6
......@@ -4,6 +4,7 @@ import shutil
import collections.abc
import numpy as np
def update_dict(d, u):
"""Updates a dictionary by adding elements to collection items associated to existing keys
......@@ -61,18 +62,23 @@ def change_config(config_file, verbose=True):
except Exception as error:
print(f'Could not change config file to {pwd}/{config_file}:\n{error}')
def parse_log(log):
msg_started = False
msg_tmp = ''
s = 0
with open(log, "r") as file:
time, process_id, msg, tag, session = [], [], [], [], []
for i,line in enumerate(file):
for i, line in enumerate(file):
if len(line.split(" | ")) > 1:
time.append(line.split(" | ")[0])
process_id.append(line.split(" | ")[1])
msg.append(":".join(line.split(" | ")[2].split(":")[1:]))
tag.append(line.split(" | ")[2].split(":")[0])
if tag[i] == 'INFO':
if 'NEW SESSION' in msg[i]:
s += 1
session.append(s)
elif "{" in line or msg_started:
msg_tmp = msg_tmp + line
print(msg_tmp)
......@@ -81,13 +87,10 @@ def parse_log(log):
msg[-1] = msg[-1] + msg_tmp
msg_tmp = ''
msg_started = False
if tag[i] == 'INFO':
if 'NEW SESSION' in msg[i]:
s+=1
session.append(s)
time = np.array(time)
process_id = np.array(process_id)
tag = np.array(tag)
msg = np.array(msg)
session = np.array(session)
return time, process_id, tag, msg, session
\ No newline at end of file
return time, process_id, tag, msg, session
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment