diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 6d8d00610ca4e8b596e2152a0b409d74c1f2e6b7..28b2b714e07b25397b13cc63bfb08ee5e56d77f6 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -482,13 +482,14 @@ class RANManagement(): mySSH.command('echo $USER; nohup sudo -E ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh > ' + lSourcePath + '/cmake_targets/enb_' + self.testCase_id + '.log 2>&1 &', lUserName, 10) - #tentative + #stats monitoring during runtime time.sleep(20) + monitor_file='stats_monitor.py' if self.eNB_Stats=='yes': - monitor_file='stats_monitor.py' - #mySSH.command('echo ' + lPassWord + ' | sudo -S cp ' + self.eNBSourceCodePath + '/ci-scripts/'+ monitor_file + ' ' + self.eNBSourceCodePath + '/cmake_targets/ran_build/build/.','\$', 5) - #mySSH.command('echo $USER; nohup python3 ' + self.eNBSourceCodePath + '/cmake_targets/ran_build/build/' + monitor_file + ' 2>&1 &', '\$', 5) - mySSH.command('echo $USER; nohup python3 ../ci-scripts/' + monitor_file + ' 2>&1 > stats_monitor_execution.log &', '\$', 5) + if (self.air_interface[self.eNB_instance] == 'lte-softmodem') or (self.air_interface[self.eNB_instance] == 'ocp-enb'): + mySSH.command('echo $USER; nohup python3 ../ci-scripts/' + monitor_file + ' \'enb\' 2>&1 > enb_stats_monitor_execution.log &', '\$', 5) + else: + mySSH.command('echo $USER; nohup python3 ../ci-scripts/' + monitor_file + ' \'gnb\' 2>&1 > gnb_stats_monitor_execution.log &', '\$', 5) @@ -686,6 +687,11 @@ class RANManagement(): fileToAnalyze = self.eNBLogFiles[int(self.eNB_instance)] self.eNBLogFiles[int(self.eNB_instance)] = '' if analyzeFile: + #*stats.log files + pickle + png + mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*stats.log', '.') + mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*.pickle', '.') + mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*.png', '.') + # copyin_res = mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/' + fileToAnalyze, '.') if (copyin_res == -1): logging.debug('\u001B[1;37;41m Could not copy ' + nodeB_prefix + 'NB logfile to analyze it! \u001B[0m') @@ -694,6 +700,11 @@ class RANManagement(): self.eNBmbmsEnables[int(self.eNB_instance)] = False return if self.eNB_serverId[self.eNB_instance] != '0': + #*stats.log files + pickle + png + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './*stats.log', self.eNBSourceCodePath + '/cmake_targets/') + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './*.pickle', self.eNBSourceCodePath + '/cmake_targets/') + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './*.png', self.eNBSourceCodePath + '/cmake_targets/') + # mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './' + fileToAnalyze, self.eNBSourceCodePath + '/cmake_targets/') logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + fileToAnalyze) logStatus = self.AnalyzeLogFile_eNB(fileToAnalyze, HTML) diff --git a/ci-scripts/stats_monitor.py b/ci-scripts/stats_monitor.py index 7ce00dab4643e00983fb61561d57144ac514420b..57a7ad043732838b1c75138f8be2f4d80fb1c0b7 100755 --- a/ci-scripts/stats_monitor.py +++ b/ci-scripts/stats_monitor.py @@ -8,8 +8,11 @@ import pickle import numpy as np import os -def collect(d): - cmd='cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log' +def collect(d, node_type): + if node_type=='enb': + cmd='cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log' + else: #'gnb' + cmd='cat nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log' process=subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE) output = process.stdout.readlines() for l in output: @@ -22,7 +25,7 @@ def collect(d): d['mcs'].append(int(result.group(4))) -def graph(d): +def graph(d, node_type): figure, axis = plt.subplots(4, 1,figsize=(10, 10)) @@ -61,11 +64,12 @@ def graph(d): plt.tight_layout() # Combine all the operations and display - plt.savefig('/tmp/stats_monitor.png') + plt.savefig('/tmp/'+node_type+'_stats_monitor.png') plt.show() if __name__ == "__main__": + node_type = sys.argv[1]#enb or gnb d={} d['PHR']=[] @@ -78,13 +82,13 @@ if __name__ == "__main__": process=subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) output = process.stdout.readlines() while len(output)!=0 : - collect(d) + collect(d, node_type) process=subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) output = process.stdout.readlines() time.sleep(1) print('process stopped') - with open('/tmp/stats_monitor.pickle', 'wb') as handle: + with open('/tmp/'+node_type+'_stats_monitor.pickle', 'wb') as handle: pickle.dump(d, handle, protocol=pickle.HIGHEST_PROTOCOL) - graph(d) + graph(d, node_type) diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 9e1c7afde37a32372ef700894c59a37ac4755753..d04719fda80e76a8eee2f8087ec0e3b191d678d5 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -65,6 +65,7 @@ <eNB_serverId>0</eNB_serverId> <air_interface>lte</air_interface> <eNB_Trace>yes</eNB_Trace> + <eNB_Stats>yes</eNB_Stats> <USRP_IPAddress>192.168.18.241</USRP_IPAddress> </testCase> @@ -76,6 +77,7 @@ <eNB_instance>1</eNB_instance> <eNB_serverId>1</eNB_serverId> <air_interface>nr</air_interface> + <eNB_Stats>yes</eNB_Stats> <USRP_IPAddress>192.168.18.240</USRP_IPAddress> </testCase>