Browse Source

Simple script to show time spent to send VBS file chunks.

master
Bob Eldering 6 months ago
commit
98b404a504
  1. 41
      jive5ab_log_parse.py

41
jive5ab_log_parse.py

@ -0,0 +1,41 @@
import matplotlib.pyplot as plt
import numpy as np
import sys
from datetime import datetime
import re
date_re_text = "(?P<date>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+)"
start_re = re.compile(date_re_text + ".*wait for remote.*")
end_re = re.compile(date_re_text + ".*closing file.*")
date_format = "%Y-%m-%d %H:%M:%S.%f"
y = []
with open(sys.argv[1], "r") as f:
start_time = None
for line in f.readlines():
match = start_re.match(line)
if match:
if start_time is not None:
print(f"Double start, old time: {start_time}")
start_time = datetime.strptime(match.group("date"), date_format)
match = end_re.match(line)
if match:
end_time = datetime.strptime(match.group("date"), date_format)
if start_time is None:
print(f"Unmatched end time: {end_time}")
else:
duration = (end_time - start_time).total_seconds()
print(start_time, end_time, duration)
y.append(duration)
start_time = None
fig, ax = plt.subplots()
ax.plot(y, ".")
ax.set(xlabel='chunk number', ylabel='transfer duration (s)')
#ax.grid()
#ax.set_ylim([0, 120])
plt.show()
Loading…
Cancel
Save