Commit 22a20f93 authored by hardy's avatar hardy

fix an error case where keys are missing

parent 0654f3fc
......@@ -161,6 +161,7 @@ def build_RT_Row(Branch,Commit,keys,filename):
row.append(Branch)
row.append(Commit)
#parsing the log file
real_time_stats = {}
f=open(filename,"r")
for line in f.readlines():
......@@ -171,14 +172,17 @@ def build_RT_Row(Branch,Commit,keys,filename):
real_time_stats[k]=tmp.group(1)
f.close()
for k in keys:
tmp=re.match(r'^(?P<metric>.*):\s+(?P<avg>\d+\.\d+) us;\s+\d+;\s+(?P<max>\d+\.\d+) us;',real_time_stats[k])
if tmp is not None:
metric=tmp.group('metric')
avg=tmp.group('avg')
max=tmp.group('max')
row.append(float(avg))
row.append(float(max))
#parsing the dictionary with the keys we are looking for
#dict may be empty if no data found above
if len(real_time_stats)!=0:
for k in keys:
tmp=re.match(r'^(?P<metric>.*):\s+(?P<avg>\d+\.\d+) us;\s+\d+;\s+(?P<max>\d+\.\d+) us;',real_time_stats[k])
if tmp is not None:
metric=tmp.group('metric')
avg=tmp.group('avg')
max=tmp.group('max')
row.append(float(avg))
row.append(float(max))
if len(row)==3: #if row was not updated (missing data for ex), then return an empty row
row=[]
......
......@@ -934,6 +934,7 @@ class RANManagement():
htmleNBFailureMsg += statMsg
#data log of gNB rela time stats
#attention this leads to reading the log file a second time, not very efficient
import cls_rt_monitor #import here (rather than on top) is to avoid installing the libs onto 4G bench servers, possibly temporary solution
cls_rt_monitor.gNB_RT_monitor(self.ranBranch,self.ranCommitID, eNBlogFile)
......
Markdown is supported
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