blob: cbea03975ed854e6fd02957d549293e5b15d38f4 [file] [log] [blame]
andrew@onlab.us5cdb2852015-03-11 15:11:10 -07001# ScaleOutTemplate -> flowTP
2#
3# CASE1 starts number of nodes specified in param file
4#
5# cameron@onlab.us
6
7import sys
8import os.path
9
10
11class flowTP1g:
12
13 def __init__( self ):
14 self.default = ''
15
cameron@onlab.us19494212015-04-01 16:12:07 -070016 def CASE1( self, main ):
andrew@onlab.us5cdb2852015-03-11 15:11:10 -070017
cameron@onlab.us19494212015-04-01 16:12:07 -070018 import time
19 global init
20 try:
21 if type(init) is not bool:
22 init = False
23 except NameError:
24 init = False
andrew@onlab.us5cdb2852015-03-11 15:11:10 -070025
26 #Load values from params file
27 checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
28 gitPull = main.params[ 'GIT' ][ 'autopull' ]
29 cellName = main.params[ 'ENV' ][ 'cellName' ]
cameron@onlab.us19494212015-04-01 16:12:07 -070030 Apps = main.params[ 'ENV' ][ 'cellApps' ]
andrew@onlab.us5cdb2852015-03-11 15:11:10 -070031 BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
32 BENCHUser = main.params[ 'BENCH' ][ 'user' ]
33 MN1Ip = main.params[ 'MN' ][ 'ip1' ]
34 maxNodes = int(main.params[ 'availableNodes' ])
andrew@onlab.us5cdb2852015-03-11 15:11:10 -070035 skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
cameron@onlab.us19494212015-04-01 16:12:07 -070036 cellName = main.params[ 'ENV' ][ 'cellName' ]
cameron@onlab.usb5eb9f42015-05-06 13:55:45 -070037
38 main.log.info("==========DEBUG VERSION 3===========")
andrew@onlab.us5cdb2852015-03-11 15:11:10 -070039
cameron@onlab.us412e9562015-05-13 16:04:34 -070040 main.exceptions = [0]*11
41 main.warnings = [0]*11
42 main.errors = [0]*11
43
cameron@onlab.us19494212015-04-01 16:12:07 -070044 # -- INIT SECTION, ONLY RUNS ONCE -- #
45 if init == False:
46 init = True
47 global clusterCount #number of nodes running
48 global ONOSIp #list of ONOS IP addresses
49 global scale
cameron@onlab.usc80a8c82015-04-15 14:57:37 -070050 global commit
andrew@onlab.us5cdb2852015-03-11 15:11:10 -070051
cameron@onlab.us19494212015-04-01 16:12:07 -070052 clusterCount = 0
53 ONOSIp = [ 0 ]
54 scale = (main.params[ 'SCALE' ]).split(",")
55 clusterCount = int(scale[0])
andrew@onlab.us5cdb2852015-03-11 15:11:10 -070056
cameron@onlab.us19494212015-04-01 16:12:07 -070057 #Populate ONOSIp with ips from params
58 for i in range(1, maxNodes + 1):
59 ipString = 'ip' + str(i)
60 ONOSIp.append(main.params[ 'CTRL' ][ ipString ])
andrew@onlab.us5cdb2852015-03-11 15:11:10 -070061
cameron@onlab.us19494212015-04-01 16:12:07 -070062 #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
63 if skipMvn != "yes":
64 mvnResult = main.ONOSbench.cleanInstall()
andrew@onlab.us5cdb2852015-03-11 15:11:10 -070065
andrew@onlab.us5cdb2852015-03-11 15:11:10 -070066 #git
67 main.step( "Git checkout and pull " + checkoutBranch )
68 if gitPull == 'on':
69 checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
70 pullResult = main.ONOSbench.gitPull()
71
72 else:
73 checkoutResult = main.TRUE
74 pullResult = main.TRUE
75 main.log.info( "Skipped git checkout and pull" )
cameron@onlab.usc80a8c82015-04-15 14:57:37 -070076
77 commit = main.ONOSbench.getVersion()
78 commit = (commit.split(" "))[1]
79
80 resultsDB = open("flowTP1gDB", "w+")
81 resultsDB.close()
andrew@onlab.us5cdb2852015-03-11 15:11:10 -070082
cameron@onlab.us19494212015-04-01 16:12:07 -070083 # -- END OF INIT SECTION --#
andrew@onlab.us5cdb2852015-03-11 15:11:10 -070084
cameron@onlab.us19494212015-04-01 16:12:07 -070085 clusterCount = int(scale[0])
86 scale.remove(scale[0])
87 main.log.info("CLUSTER COUNT: " + str(clusterCount))
88
89 #kill off all onos processes
90 main.log.step("Safety check, killing all ONOS processes")
91 main.log.step("before initiating enviornment setup")
92 for node in range(1, maxNodes + 1):
93 main.ONOSbench.onosDie(ONOSIp[node])
94
95 #Uninstall everywhere
96 main.log.step( "Cleaning Enviornment..." )
97 for i in range(1, maxNodes + 1):
98 main.log.info(" Uninstalling ONOS " + str(i) )
99 main.ONOSbench.onosUninstall( ONOSIp[i] )
100
101 #construct the cell file
102 main.log.info("Creating cell file")
103 cellIp = []
104 for node in range (1, clusterCount + 1):
105 cellIp.append(ONOSIp[node])
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700106
cameron@onlab.us19494212015-04-01 16:12:07 -0700107 main.ONOSbench.createCellFile(BENCHIp,cellName,MN1Ip,str(Apps), *cellIp)
108 main.log.info("Cell Ip list: " + str(cellIp))
109
110 main.step( "Set Cell" )
111 main.ONOSbench.setCell(cellName)
112
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700113 main.step( "Creating ONOS package" )
114 packageResult = main.ONOSbench.onosPackage()
115
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700116 main.step( "verify cells" )
117 verifyCellResult = main.ONOSbench.verifyCell()
118
cameron@onlab.us19494212015-04-01 16:12:07 -0700119 main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
120 for node in range(1, clusterCount + 1):
121 main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
122 main.ONOSbench.onosInstall( ONOSIp[node])
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700123
cameron@onlab.us19494212015-04-01 16:12:07 -0700124 for node in range(1, clusterCount + 1):
125 for i in range( 2 ):
126 isup = main.ONOSbench.isup( ONOSIp[node] )
127 if isup:
128 main.log.info("ONOS " + str(node) + " is up\n")
129 break
130 if not isup:
131 main.log.report( "ONOS " + str(node) + " didn't start!" )
132
133 for node in range(1, clusterCount + 1):
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700134 exec "a = main.ONOS%scli.startOnosCli" %str(node)
135 a(ONOSIp[node])
cameron@onlab.us19494212015-04-01 16:12:07 -0700136
137 main.log.info("Startup sequence complete")
cameron@onlab.us412e9562015-05-13 16:04:34 -0700138 main.ONOSbench.onosErrorLog(ONOSIp[1])
cameron@onlab.us19494212015-04-01 16:12:07 -0700139
140 def CASE2( self, main ):
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700141 #
142 # This is the flow TP test
143 #
144 import os.path
145 import numpy
146 import math
147 import time
148 import datetime
149 import traceback
150
cameron@onlab.uscd4e8a22015-05-11 10:58:43 -0700151 global currentNeighbors
152 try:
cameron@onlab.us50dacf82015-05-08 14:56:42 -0700153 currentNeighbors
cameron@onlab.uscd4e8a22015-05-11 10:58:43 -0700154 except:
cameron@onlab.us50dacf82015-05-08 14:56:42 -0700155 currentNeighbors = "0"
cameron@onlab.uscd4e8a22015-05-11 10:58:43 -0700156 else:
cameron@onlab.us50dacf82015-05-08 14:56:42 -0700157 if currentNeighbors == "r": #reset
158 currentNeighbors = "0"
cameron@onlab.uscd4e8a22015-05-11 10:58:43 -0700159 else:
cameron@onlab.us50dacf82015-05-08 14:56:42 -0700160 currentNeighbors = "a"
161
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700162 testCMD = [ 0,0,0,0 ]
163 warmUp = int(main.params[ 'TEST' ][ 'warmUp' ])
164 sampleSize = int(main.params[ 'TEST' ][ 'sampleSize' ])
165 switches = int(main.params[ 'TEST' ][ 'switches' ])
cameron@onlab.us19494212015-04-01 16:12:07 -0700166 neighborList = (main.params[ 'TEST' ][ 'neighbors' ]).split(",")
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700167 testCMD[0] = main.params[ 'TEST' ][ 'testCMD0' ]
168 testCMD[1] = main.params[ 'TEST' ][ 'testCMD1' ]
169 maxNodes = main.params[ 'availableNodes' ]
170 onBaremetal = main.params['isOnBaremetal']
cameron@onlab.usb5eb9f42015-05-06 13:55:45 -0700171 cooldown = main.params[ 'TEST' ][ 'cooldown' ]
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700172 cellName = main.params[ 'ENV' ][ 'cellName' ]
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700173 BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
174 BENCHUser = main.params[ 'BENCH' ][ 'user' ]
175 MN1Ip = main.params[ 'MN' ][ 'ip1' ]
176 maxNodes = int(main.params[ 'availableNodes' ])
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700177 homeDir = os.path.expanduser('~')
cameron@onlab.usb5eb9f42015-05-06 13:55:45 -0700178 flowRuleBackup = str(main.params[ 'TEST' ][ 'enableFlowRuleStoreBackup' ])
cameron@onlab.uscd4e8a22015-05-11 10:58:43 -0700179 main.log.info("Flow Rule Backup is set to:" + flowRuleBackup)
cameron@onlab.usb5eb9f42015-05-06 13:55:45 -0700180
cameron@onlab.us19494212015-04-01 16:12:07 -0700181 servers = str(clusterCount)
cameron@onlab.us19494212015-04-01 16:12:07 -0700182
183 if clusterCount == 1:
184 neighborList = ['0']
cameron@onlab.us50dacf82015-05-08 14:56:42 -0700185 currentNeighbors = "r"
cameron@onlab.uscd4e8a22015-05-11 10:58:43 -0700186 else:
187 if currentNeighbors == "a":
cameron@onlab.us50dacf82015-05-08 14:56:42 -0700188 neighborList = [str(clusterCount-1)]
cameron@onlab.uscd4e8a22015-05-11 10:58:43 -0700189 currentNeighbors = "r"
cameron@onlab.us50dacf82015-05-08 14:56:42 -0700190 else:
cameron@onlab.uscd4e8a22015-05-11 10:58:43 -0700191 neighborList = ['0']
cameron@onlab.us50dacf82015-05-08 14:56:42 -0700192
cameron@onlab.uscd4e8a22015-05-11 10:58:43 -0700193 main.log.info("neightborlist: " + str(neighborList))
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700194
195 ts = time.time()
196 st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S')
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700197
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700198 #write file to change mem limit to 32 gigs (BAREMETAL ONLY!)
199 if onBaremetal == "true":
200 filename = "/onos/tools/package/bin/onos-service"
201 serviceConfig = open(homeDir + filename, 'w+')
202 serviceConfig.write("#!/bin/bash\n ")
203 serviceConfig.write("#------------------------------------- \n ")
204 serviceConfig.write("# Starts ONOS Apache Karaf container\n ")
205 serviceConfig.write("#------------------------------------- \n ")
206 serviceConfig.write("#export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-7-openjdk-amd64/}\n ")
jenkins399e2512015-03-24 10:31:57 -0700207 serviceConfig.write("""export JAVA_OPTS="${JAVA_OPTS:--Xms8G -Xmx8G}" \n """)
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700208 serviceConfig.write("")
209 serviceConfig.write("ONOS_HOME=/opt/onos \n ")
210 serviceConfig.write("")
211 serviceConfig.write("[ -d $ONOS_HOME ] && cd $ONOS_HOME || ONOS_HOME=$(dirname $0)/..\n")
212 serviceConfig.write("""${ONOS_HOME}/apache-karaf-$KARAF_VERSION/bin/karaf "$@" \n """)
213 serviceConfig.close()
214
215 for n in neighborList:
cameron@onlab.us19494212015-04-01 16:12:07 -0700216 main.log.step("\tSTARTING TEST")
217 main.log.step("\tLOADING FROM SERVERS: \t" + str(clusterCount) )
218 main.log.step("\tNEIGHBORS:\t" + n )
219 main.log.info("=============================================================")
220 main.log.info("=============================================================")
221 #write file to configure nil link
222 ipCSV = ""
223 for i in range (1, int(maxNodes) + 1):
224 tempstr = "ip" + str(i)
225 ipCSV += main.params[ 'CTRL' ][ tempstr ]
226 if i < int(maxNodes):
227 ipCSV +=","
cameron@onlab.usb5eb9f42015-05-06 13:55:45 -0700228
229
cameron@onlab.usc80a8c82015-04-15 14:57:37 -0700230 main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders deviceCount 35" """)
231 main.ONOSbench.handle.expect(":~")
cameron@onlab.usb5eb9f42015-05-06 13:55:45 -0700232 time.sleep(3)
cameron@onlab.usc80a8c82015-04-15 14:57:37 -0700233 main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders topoShape linear" """)
234 main.ONOSbench.handle.expect(":~")
cameron@onlab.usb5eb9f42015-05-06 13:55:45 -0700235 time.sleep(3)
cameron@onlab.usc80a8c82015-04-15 14:57:37 -0700236 main.ONOSbench.handle.sendline("""onos $OC1 "null-simulation start" """)
237 main.ONOSbench.handle.expect(":~")
cameron@onlab.usb5eb9f42015-05-06 13:55:45 -0700238 time.sleep(3)
cameron@onlab.usc80a8c82015-04-15 14:57:37 -0700239 main.ONOSbench.handle.sendline("""onos $OC1 "balance-masters" """)
240 main.ONOSbench.handle.expect(":~")
cameron@onlab.usb5eb9f42015-05-06 13:55:45 -0700241 time.sleep(3)
cameron@onlab.uscd4e8a22015-05-11 10:58:43 -0700242 main.log.info("""onos $OC1 "cfg set org.onosproject.store.flow.impl.NewDistributedFlowRuleStore backupEnabled """ + flowRuleBackup + """" """)
243 main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.store.flow.impl.NewDistributedFlowRuleStore backupEnabled """ + flowRuleBackup + """" """)
cameron@onlab.usb5eb9f42015-05-06 13:55:45 -0700244 main.ONOSbench.handle.expect(":~")
245
246 main.ONOSbench.handle.sendline("onos $OC1 summary")
247 main.ONOSbench.handle.expect(":~")
248 check = main.ONOSbench.handle.before
cameron@onlab.uscd4e8a22015-05-11 10:58:43 -0700249
250 main.ONOSbench.handle.sendline("""onos $OC1 "cfg get" """)
251 main.ONOSbench.handle.expect(":~")
252 check = main.ONOSbench.handle.before
cameron@onlab.usb5eb9f42015-05-06 13:55:45 -0700253 main.log.info("\nStart up check: \n" + check + "\n")
254
cameron@onlab.us19494212015-04-01 16:12:07 -0700255 #devide flows
256 flows = int(main.params[ 'TEST' ][ 'flows' ])
257 main.log.info("Flow Target = " + str(flows))
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700258
cameron@onlab.us19494212015-04-01 16:12:07 -0700259 flows = (flows *max(int(n)+1,int(servers)))/((int(n) + 1)*int(servers)*(switches))
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700260
cameron@onlab.us19494212015-04-01 16:12:07 -0700261 main.log.info("Flows per switch = " + str(flows))
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700262
cameron@onlab.us19494212015-04-01 16:12:07 -0700263 #build list of servers in "$OC1, $OC2...." format
264 serverEnvVars = ""
265 for i in range (1,int(servers)+1):
266 serverEnvVars += ("-s " + ONOSIp[i] + " ")
267
268 data = [[""]*int(servers)]*int(sampleSize)
269 maxes = [""]*int(sampleSize)
270
cameron@onlab.usb5eb9f42015-05-06 13:55:45 -0700271 flowCMD = "python3 " + homeDir + "/onos/tools/test/bin/"
272 flowCMD += testCMD[0] + " " + str(flows) + " " + testCMD[1]
273 flowCMD += " " + str(n) + " " + str(serverEnvVars) + "-j"
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700274
cameron@onlab.usb5eb9f42015-05-06 13:55:45 -0700275 main.log.info(flowCMD)
276 #time.sleep(60)
277
278 for test in range(0, warmUp + sampleSize):
279 if test < warmUp:
280 main.log.info("Warm up " + str(test + 1) + " of " + str(warmUp))
281 else:
282 main.log.info("====== Test run: " + str(test-warmUp+1) + " ======")
283
284 main.ONOSbench.handle.sendline(flowCMD)
285 main.ONOSbench.handle.expect(":~")
286 rawResult = main.ONOSbench.handle.before
287 main.log.info("Raw results: \n" + rawResult + "\n")
288
289 if "failed" in rawResult:
290 main.log.report("FLOW_TESTER.PY FAILURE")
291 main.log.report( " \n" + rawResult + " \n")
292 break
293
294 ########################################################################################
cameron@onlab.us19494212015-04-01 16:12:07 -0700295 result = [""]*(clusterCount)
296 rawResult = rawResult.splitlines()
cameron@onlab.usb5eb9f42015-05-06 13:55:45 -0700297
cameron@onlab.us19494212015-04-01 16:12:07 -0700298 for node in range(1, clusterCount + 1):
cameron@onlab.usc80a8c82015-04-15 14:57:37 -0700299 for line in rawResult:
cameron@onlab.usb5eb9f42015-05-06 13:55:45 -0700300 #print("line: " + line)
301 if ONOSIp[node] in line and "server" in line:
302 temp = line.split(" ")
303 for word in temp:
304 #print ("word: " + word)
305 if "elapsed" in repr(word):
306 #print("in elapsed ==========")
307 index = temp.index(word) + 1
308 #print ("index: " + str(index))
309 #print ("temp[index]: " + temp[index])
310 myParsed = (temp[index]).replace(",","")
311 myParsed = myParsed.replace("}","")
312 myParsed = int(myParsed)
313 result[node-1] = myParsed
314 main.log.info( ONOSIp[node] + " : " + str(myParsed))
315 break
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700316
cameron@onlab.us19494212015-04-01 16:12:07 -0700317 if test >= warmUp:
318 for i in result:
319 if i == "":
320 main.log.error("Missing data point, critical failure incoming")
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700321
cameron@onlab.us19494212015-04-01 16:12:07 -0700322 print result
323 maxes[test-warmUp] = max(result)
324 main.log.info("Data collection iteration: " + str(test-warmUp) + " of " + str(sampleSize))
325 main.log.info("Throughput time: " + str(maxes[test-warmUp]) + "(ms)")
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700326
cameron@onlab.us19494212015-04-01 16:12:07 -0700327 data[test-warmUp] = result
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700328
cameron@onlab.us19494212015-04-01 16:12:07 -0700329 # wait for flows = 0
cameron@onlab.uscd4e8a22015-05-11 10:58:43 -0700330 for checkCount in range(0,5):
331 time.sleep(10)
cameron@onlab.usb5eb9f42015-05-06 13:55:45 -0700332 main.ONOSbench.handle.sendline("onos $OC1 summary")
333 main.ONOSbench.handle.expect(":~")
334 flowCheck = main.ONOSbench.handle.before
335 if "flows=0," in flowCheck:
336 main.log.info("Flows removed")
337 break
338 else:
339 for line in flowCheck.splitlines():
340 if "flows=" in line:
341 main.log.info("Current Summary: " + line)
342 if checkCount == 2:
343 main.log.info("Flows are stuck, moving on ")
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700344
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700345
cameron@onlab.usb5eb9f42015-05-06 13:55:45 -0700346 time.sleep(5)
347
cameron@onlab.us19494212015-04-01 16:12:07 -0700348 main.log.info("raw data: " + str(data))
349 main.log.info("maxes:" + str(maxes))
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700350
cameron@onlab.us19494212015-04-01 16:12:07 -0700351
352 # report data
353 print("")
354 main.log.info("\t Results (measurments are in milliseconds)")
355 print("")
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700356
cameron@onlab.us19494212015-04-01 16:12:07 -0700357 nodeString = ""
358 for i in range(1, int(servers) + 1):
359 nodeString += ("\tNode " + str(i))
360
361 for test in range(0, sampleSize ):
362 main.log.info("\t Test iteration " + str(test + 1) )
363 main.log.info("\t------------------")
364 main.log.info(nodeString)
365 resultString = ""
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700366
cameron@onlab.us19494212015-04-01 16:12:07 -0700367 for i in range(0, int(servers) ):
368 resultString += ("\t" + str(data[test][i]) )
369 main.log.info(resultString)
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700370
cameron@onlab.us19494212015-04-01 16:12:07 -0700371 print("\n")
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700372
cameron@onlab.us19494212015-04-01 16:12:07 -0700373 avgOfMaxes = numpy.mean(maxes)
374 main.log.info("Average of max value from each test iteration: " + str(avgOfMaxes))
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700375
cameron@onlab.us19494212015-04-01 16:12:07 -0700376 stdOfMaxes = numpy.std(maxes)
377 main.log.info("Standard Deviation of max values: " + str(stdOfMaxes))
378 print("\n\n")
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700379
cameron@onlab.us19494212015-04-01 16:12:07 -0700380 avgTP = int(main.params[ 'TEST' ][ 'flows' ]) / avgOfMaxes #result in kflows/second
381
382 tp = []
383 for i in maxes:
384 tp.append((int(main.params[ 'TEST' ][ 'flows' ]) / i ))
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700385
cameron@onlab.us19494212015-04-01 16:12:07 -0700386 stdTP = numpy.std(tp)
andrew@onlab.us5cdb2852015-03-11 15:11:10 -0700387
cameron@onlab.us19494212015-04-01 16:12:07 -0700388 main.log.info("Average thoughput: " + str(avgTP) + " Kflows/second" )
389 main.log.info("Standard deviation of throughput: " + str(stdTP) + " Kflows/second")
390
cameron@onlab.usc80a8c82015-04-15 14:57:37 -0700391 resultsLog = open("flowTP1gDB","a")
cameron@onlab.usb5eb9f42015-05-06 13:55:45 -0700392 resultString = ("'" + commit + "',")
393 resultString += ("'1gig',")
394 resultString += ((main.params[ 'TEST' ][ 'flows' ]) + ",")
395 resultString += (str(clusterCount) + ",")
396 resultString += (str(n) + ",")
397 resultString += (str(avgTP) + "," + str(stdTP) + "\n")
398 resultsLog.write(resultString)
cameron@onlab.us19494212015-04-01 16:12:07 -0700399 resultsLog.close()
cameron@onlab.usb5eb9f42015-05-06 13:55:45 -0700400
401 main.log.report("Result line to file: " + resultString)
402
cameron@onlab.us412e9562015-05-13 16:04:34 -0700403 main.ONOSbench.onosErrorLog(ONOSIp[1])