Commit 827c6795 authored by hardy's avatar hardy

fix copy of ping graph

parent 68fc6e4e
...@@ -65,7 +65,7 @@ import numpy as np ...@@ -65,7 +65,7 @@ import numpy as np
# Utility functions # Utility functions
#----------------------------------------------------------- #-----------------------------------------------------------
def GetPingTimeAnalysis(ping_log_file,ping_rttavg_threshold): def GetPingTimeAnalysis(RAN,ping_log_file,ping_rttavg_threshold):
#ping time values read from file #ping time values read from file
t_ping=[] t_ping=[]
#ping stats (dictionary) to be returned by the function #ping stats (dictionary) to be returned by the function
...@@ -89,12 +89,13 @@ def GetPingTimeAnalysis(ping_log_file,ping_rttavg_threshold): ...@@ -89,12 +89,13 @@ def GetPingTimeAnalysis(ping_log_file,ping_rttavg_threshold):
max_loc=t_ping.index(max(t_ping)) max_loc=t_ping.index(max(t_ping))
ping_stat['max_loc']=max_loc ping_stat['max_loc']=max_loc
#remove it #remove it
t_ping.pop(max_loc) t_ping_post=t_ping.copy()
t_ping_post.pop(max_loc)
#new stats after removing max value #new stats after removing max value
ping_stat['min_1']=min(t_ping) ping_stat['min_1']=min(t_ping_post)
ping_stat['mean_1']=stat.mean(t_ping) ping_stat['mean_1']=stat.mean(t_ping_post)
ping_stat['median_1']=stat.median(t_ping) ping_stat['median_1']=stat.median(t_ping_post)
ping_stat['max_1']=max(t_ping) ping_stat['max_1']=max(t_ping_post)
#plot ping over time and save png for artifacts #plot ping over time and save png for artifacts
ticks = np.arange(0, len(t_ping), 1) ticks = np.arange(0, len(t_ping), 1)
...@@ -118,7 +119,7 @@ def GetPingTimeAnalysis(ping_log_file,ping_rttavg_threshold): ...@@ -118,7 +119,7 @@ def GetPingTimeAnalysis(ping_log_file,ping_rttavg_threshold):
#copy the png file already to enb to move it move it later into the artifacts #copy the png file already to enb to move it move it later into the artifacts
mySSH = sshconnection.SSHConnection() mySSH = sshconnection.SSHConnection()
mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, ping_log_file+'.png', self.eNBSourceCodePath + '/cmake_targets/') mySSH.copyout(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, ping_log_file+'.png', RAN.eNBSourceCodePath + '/cmake_targets/')
return ping_stat return ping_stat
...@@ -1559,7 +1560,7 @@ class OaiCiTest(): ...@@ -1559,7 +1560,7 @@ class OaiCiTest():
statusQueue.put(message) statusQueue.put(message)
lock.release() lock.release()
def Ping_common(self, lock, UE_IPAddress, device_id, statusQueue,EPC, Module_UE): def Ping_common(self, lock, UE_IPAddress, device_id, statusQueue,EPC, Module_UE,RAN):
try: try:
SSH = sshconnection.SSHConnection() SSH = sshconnection.SSHConnection()
# Launch ping on the EPC side (true for ltebox and old open-air-cn) # Launch ping on the EPC side (true for ltebox and old open-air-cn)
...@@ -1674,7 +1675,7 @@ class OaiCiTest(): ...@@ -1674,7 +1675,7 @@ class OaiCiTest():
#adding extra ping stats from local file #adding extra ping stats from local file
#ping_log_file variable is defined above in this function, depending on device/ue #ping_log_file variable is defined above in this function, depending on device/ue
logging.debug('Analyzing Ping log file : ' + os.getcwd() + '/' + ping_log_file) logging.debug('Analyzing Ping log file : ' + os.getcwd() + '/' + ping_log_file)
ping_stat=GetPingTimeAnalysis(ping_log_file,self.ping_rttavg_threshold) ping_stat=GetPingTimeAnalysis(RAN,ping_log_file,self.ping_rttavg_threshold)
ping_stat_msg='' ping_stat_msg=''
if (ping_stat!=-1) and (len(ping_stat)!=0): if (ping_stat!=-1) and (len(ping_stat)!=0):
ping_stat_msg+='Ping stats before removing largest value : \n' ping_stat_msg+='Ping stats before removing largest value : \n'
...@@ -1864,7 +1865,7 @@ class OaiCiTest(): ...@@ -1864,7 +1865,7 @@ class OaiCiTest():
device_id = self.UEDevices[i] device_id = self.UEDevices[i]
else: else:
device_id = Module_UE.ID + "-" + Module_UE.Kind device_id = Module_UE.ID + "-" + Module_UE.Kind
p = Process(target = self.Ping_common, args = (lock,UE_IPAddress,device_id,status_queue,EPC,Module_UE,)) p = Process(target = self.Ping_common, args = (lock,UE_IPAddress,device_id,status_queue,EPC,Module_UE,RAN,))
p.daemon = True p.daemon = True
p.start() p.start()
multi_jobs.append(p) multi_jobs.append(p)
......
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