fix stats logs concatenation
This commit is contained in:
@@ -60,18 +60,17 @@ class StatMonitor():
|
|||||||
self.d[node_type]['mcs'].append(int(result.group(4)))
|
self.d[node_type]['mcs'].append(int(result.group(4)))
|
||||||
|
|
||||||
|
|
||||||
def collect(self,node_type):
|
def collect(self,testcase_id,node_type):
|
||||||
if node_type=='enb':
|
if node_type=='enb':
|
||||||
files = ["L1_stats.log", "MAC_stats.log", "PDCP_stats.log", "RRC_stats.log"]
|
files = ["L1_stats.log", "MAC_stats.log", "PDCP_stats.log", "RRC_stats.log"]
|
||||||
else: #'gnb'
|
else: #'gnb'
|
||||||
files = ["nrL1_stats.log", "nrMAC_stats.log", "nrPDCP_stats.log", "nrRRC_stats.log"]
|
files = ["nrL1_stats.log", "nrMAC_stats.log", "nrPDCP_stats.log", "nrRRC_stats.log"]
|
||||||
# append each file's contents to another file (prepended with CI-) for
|
#append each file's contents to another file (prepended with CI-) for debug
|
||||||
# post-mortem/debugging analysis
|
for f in files:
|
||||||
#for f in files:
|
if os.path.isfile(f):
|
||||||
# cmd = 'cat '+ f + ' >> CI-' + f
|
cmd = 'cat '+ f + ' >> CI-'+testcase_id+'-'+f
|
||||||
# if os.path.isfile(f):
|
subprocess.Popen(cmd,shell=True)
|
||||||
# subprocess.Popen(cmd,shell=True)
|
#join the files for further processing
|
||||||
# join the files for further processing
|
|
||||||
cmd='cat '
|
cmd='cat '
|
||||||
for f in files:
|
for f in files:
|
||||||
if os.path.isfile(f):
|
if os.path.isfile(f):
|
||||||
@@ -130,7 +129,7 @@ if __name__ == "__main__":
|
|||||||
process=subprocess.Popen(CMD, shell=True, stdout=subprocess.PIPE)
|
process=subprocess.Popen(CMD, shell=True, stdout=subprocess.PIPE)
|
||||||
output = process.stdout.readlines()
|
output = process.stdout.readlines()
|
||||||
while len(output)!=0 :
|
while len(output)!=0 :
|
||||||
mon.collect(node)
|
mon.collect(testcase_id,node)
|
||||||
process=subprocess.Popen(CMD, shell=True, stdout=subprocess.PIPE)
|
process=subprocess.Popen(CMD, shell=True, stdout=subprocess.PIPE)
|
||||||
output = process.stdout.readlines()
|
output = process.stdout.readlines()
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user