refined evaluation script
This commit is contained in:
parent
7d4ec5de59
commit
23ce2b9088
@ -12,20 +12,23 @@ from collections import deque
|
|||||||
abspath = os.path.abspath(__file__)
|
abspath = os.path.abspath(__file__)
|
||||||
dname = os.path.dirname(abspath)
|
dname = os.path.dirname(abspath)
|
||||||
|
|
||||||
outputFileName = dname + "\\" + 'output.csv'
|
outputFileNameDBH = dname + "\\" + 'output_dbh.csv'
|
||||||
|
outputFileNameHISNORD = dname + "\\" + 'output_hisnord.csv'
|
||||||
|
|
||||||
# open the output file
|
# open the output files
|
||||||
outputFile = open(outputFileName, 'w')
|
outputFileDBH = open(outputFileNameDBH, 'w')
|
||||||
|
outputFileHISNORD = open(outputFileNameHISNORD, 'w')
|
||||||
|
|
||||||
# write the header
|
# write the header
|
||||||
|
|
||||||
outputFile.write('Receive time, Duration\n')
|
outputFileDBH.write('Receive time, Duration, Message class, Attempts\n')
|
||||||
|
outputFileHISNORD.write('Receive time, Duration, message class, Attemps\n')
|
||||||
|
|
||||||
# open the log files
|
# open the log files
|
||||||
|
|
||||||
q = deque()
|
q = deque()
|
||||||
|
|
||||||
for i in range(0, 10):
|
for i in range(1, -1, -1):
|
||||||
logFileName = dname + "\\" + 'log-NSWMessageService.txt.' + str(i)
|
logFileName = dname + "\\" + 'log-NSWMessageService.txt.' + str(i)
|
||||||
logFile = open(logFileName, 'r')
|
logFile = open(logFileName, 'r')
|
||||||
|
|
||||||
@ -38,6 +41,8 @@ for i in range(0, 10):
|
|||||||
# get substring of the date
|
# get substring of the date
|
||||||
dateString = line[0:19]
|
dateString = line[0:19]
|
||||||
|
|
||||||
|
|
||||||
|
# kept old code for reference, but it does nothing
|
||||||
if "Upload of" in line:
|
if "Upload of" in line:
|
||||||
# add the dateString to the queue
|
# add the dateString to the queue
|
||||||
q.appendleft(dateString)
|
q.appendleft(dateString)
|
||||||
@ -54,9 +59,21 @@ for i in range(0, 10):
|
|||||||
|
|
||||||
# calculate the duration
|
# calculate the duration
|
||||||
duration = currentdate - lastdate
|
duration = currentdate - lastdate
|
||||||
outputFile.write(dateString + "," + str(duration.seconds) + "\n")
|
|
||||||
|
# outputFile.write(dateString + "," + str(duration.seconds) + "\n")
|
||||||
|
|
||||||
|
if "MessageTelemetry" in line:
|
||||||
|
his = line[72:81].strip()
|
||||||
|
msg_class = line[83:91].strip()
|
||||||
|
duration = line[93:98]
|
||||||
|
tries = line[100:102]
|
||||||
|
if his == 'DUDR':
|
||||||
|
outputFileHISNORD.write(dateString + "," + duration + "," + msg_class + "," + tries + "\n")
|
||||||
|
elif his == 'DBH':
|
||||||
|
outputFileDBH.write(dateString + "," + duration + "," + msg_class + "," + tries + "\n")
|
||||||
|
|
||||||
# close the log file
|
# close the log file
|
||||||
logFile.close()
|
logFile.close()
|
||||||
|
|
||||||
outputFile.close()
|
outputFileDBH.close()
|
||||||
|
outputFileHISNORD.close()
|
||||||
Loading…
Reference in New Issue
Block a user