Commit 0654f3fc authored by hardy's avatar hardy

case where data is not found : do not insert row, do not update charts

parent 14cc352a
...@@ -173,12 +173,15 @@ def build_RT_Row(Branch,Commit,keys,filename): ...@@ -173,12 +173,15 @@ def build_RT_Row(Branch,Commit,keys,filename):
for k in keys: 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]) 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') metric=tmp.group('metric')
avg=tmp.group('avg') avg=tmp.group('avg')
max=tmp.group('max') max=tmp.group('max')
row.append(float(avg)) row.append(float(avg))
row.append(float(max)) row.append(float(max))
if len(row)==3: #if row was not updated (missing data for ex), then return an empty row
row=[]
return row return row
#----------------------------------------------------------- #-----------------------------------------------------------
...@@ -294,10 +297,10 @@ def gNB_RT_monitor(ranBranch, ranCommitID, eNBlogFile): ...@@ -294,10 +297,10 @@ def gNB_RT_monitor(ranBranch, ranCommitID, eNBlogFile):
#open gsheet #open gsheet
gRT=gSheet("/home/oaicicd/ci_gsheet_creds.json", 'RealTime Monitor', 'timeseries', columns, 10000, 50) gRT=gSheet("/home/oaicicd/ci_gsheet_creds.json", 'RealTime Monitor', 'timeseries', columns, 10000, 50)
#insert row #build row, but insert row and update charts only if data were found
row=build_RT_Row(ranBranch,ranCommitID,keys,eNBlogFile) row=build_RT_Row(ranBranch,ranCommitID,keys,eNBlogFile)
if len(row)!=0:
gRT.insertRow(row) gRT.insertRow(row)
#updating charts #updating charts
#will plot avg and max on the same chart, these 2 columns have to be side by side #will plot avg and max on the same chart, these 2 columns have to be side by side
#spreadsheet , chart name, chart type, x title , y title, start row inc header, end row, start col, end col #spreadsheet , chart name, chart type, x title , y title, start row inc header, end row, start col, end col
......
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