cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 1 | # ScaleOutTemplate -> flowTP |
| 2 | # |
| 3 | # CASE1 starts number of nodes specified in param file |
| 4 | # |
| 5 | # cameron@onlab.us |
| 6 | |
| 7 | import sys |
| 8 | import os.path |
| 9 | |
| 10 | |
| 11 | class SCPFflowTp1g: |
| 12 | |
| 13 | def __init__( self ): |
| 14 | self.default = '' |
| 15 | |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 16 | def CASE1( self, main ): |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 17 | |
| 18 | import time |
| 19 | global init |
| 20 | try: |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 21 | if type( init ) is not bool: |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 22 | init = False |
| 23 | except NameError: |
| 24 | init = False |
| 25 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 26 | main.log.info( "==========DEBUG VERSION 3===========" ) |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 27 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 28 | # -- INIT SECTION, ONLY RUNS ONCE -- # |
| 29 | if init == False: |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 30 | try: |
| 31 | init = True |
| 32 | try: |
| 33 | from tests.dependencies.ONOSSetup import ONOSSetup |
| 34 | main.testSetUp = ONOSSetup() |
| 35 | except ImportError: |
| 36 | main.log.error( "ONOSSetup not found. exiting the test" ) |
| 37 | main.exit() |
| 38 | main.testSetUp.envSetupDescription() |
| 39 | #Load values from params file |
| 40 | cellName = main.params[ 'ENV' ][ 'cellName' ] |
| 41 | main.apps = main.params[ 'ENV' ][ 'cellApps' ] |
| 42 | BENCHUser = main.params[ 'BENCH' ][ 'user' ] |
| 43 | BENCHIp = main.params[ 'BENCH' ][ 'ip1' ] |
| 44 | main.scale = ( main.params[ 'SCALE' ] ).split( "," ) |
| 45 | stepResult = main.testSetUp.envSetup() |
| 46 | resultsDB = open( "/tmp/flowTP1gDB", "w+" ) |
| 47 | resultsDB.close() |
| 48 | except Exception as e: |
| 49 | main.testSetUp.envSetupException( e ) |
| 50 | main.testSetUp.evnSetupConclusion( stepResult ) |
| 51 | main.commit = (main.commit.split(" "))[1] |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 52 | # -- END OF INIT SECTION --# |
| 53 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 54 | main.testSetUp.ONOSSetUp( "localhost", True, cellName=cellName ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 55 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 56 | main.log.info("Startup sequence complete") |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 57 | main.ONOSbench.logReport(main.ONOSip[0], ["ERROR", "WARNING", "EXCEPT"], outputMode="d") |
Chiyu Cheng | ef10950 | 2016-11-21 15:51:38 -0800 | [diff] [blame] | 58 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 59 | def CASE2( self, main ): |
| 60 | # |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 61 | # This is the flow TP test |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 62 | # |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 63 | import os.path |
| 64 | import numpy |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 65 | import math |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 66 | import time |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 67 | import datetime |
| 68 | import traceback |
| 69 | |
| 70 | global currentNeighbors |
| 71 | try: |
| 72 | currentNeighbors |
| 73 | except: |
| 74 | currentNeighbors = (main.params[ 'TEST' ][ 'neighbors' ]).split(",")[0] |
| 75 | else: |
| 76 | if currentNeighbors == "r": #reset |
| 77 | currentNeighbors = "0" |
| 78 | else: |
| 79 | currentNeighbors = "a" |
| 80 | |
| 81 | testCMD = [ 0,0,0,0 ] |
| 82 | warmUp = int(main.params[ 'TEST' ][ 'warmUp' ]) |
| 83 | sampleSize = int(main.params[ 'TEST' ][ 'sampleSize' ]) |
| 84 | switches = int(main.params[ 'TEST' ][ 'switches' ]) |
| 85 | neighborList = (main.params[ 'TEST' ][ 'neighbors' ]).split(",") |
| 86 | testCMD[0] = main.params[ 'TEST' ][ 'testCMD0' ] |
| 87 | testCMD[1] = main.params[ 'TEST' ][ 'testCMD1' ] |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 88 | cooldown = main.params[ 'TEST' ][ 'cooldown' ] |
| 89 | cellName = main.params[ 'ENV' ][ 'cellName' ] |
| 90 | BENCHIp = main.params[ 'BENCH' ][ 'ip1' ] |
| 91 | BENCHUser = main.params[ 'BENCH' ][ 'user' ] |
| 92 | MN1Ip = main.params[ 'MN' ][ 'ip1' ] |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 93 | homeDir = os.path.expanduser('~') |
| 94 | flowRuleBackup = str(main.params[ 'TEST' ][ 'enableFlowRuleStoreBackup' ]) |
| 95 | main.log.info("Flow Rule Backup is set to:" + flowRuleBackup) |
| 96 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 97 | servers = str( main.numCtrls ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 98 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 99 | if main.numCtrls == 1: |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 100 | neighborList = ['0'] |
| 101 | currentNeighbors = "r" |
| 102 | else: |
| 103 | if currentNeighbors == "a": |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 104 | neighborList = [ str( main.numCtrls - 1 ) ] |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 105 | currentNeighbors = "r" |
| 106 | else: |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 107 | neighborList = ['0'] |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 108 | |
| 109 | main.log.info("neightborlist: " + str(neighborList)) |
| 110 | |
| 111 | ts = time.time() |
| 112 | st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S') |
| 113 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 114 | for n in neighborList: |
Jon Hall | 6509dbf | 2016-06-21 17:01:17 -0700 | [diff] [blame] | 115 | main.step("\tSTARTING TEST") |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 116 | main.step("\tLOADING FROM SERVERS: \t" + str( main.numCtrls ) ) |
Jon Hall | 6509dbf | 2016-06-21 17:01:17 -0700 | [diff] [blame] | 117 | main.step("\tNEIGHBORS:\t" + n ) |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 118 | main.log.info("=============================================================") |
| 119 | main.log.info("=============================================================") |
| 120 | #write file to configure nil link |
| 121 | ipCSV = "" |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 122 | for i in range ( main.maxNodes ): |
| 123 | tempstr = "ip" + str( i + 1 ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 124 | ipCSV += main.params[ 'CTRL' ][ tempstr ] |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 125 | if i + 1 < main.maxNodes: |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 126 | ipCSV +="," |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 127 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 128 | main.ONOSbench.onosCfgSet(main.ONOSip[0], "org.onosproject.store.flow.impl.DistributedFlowRuleStore", "backupCount 1") |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 129 | for i in range(3): |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 130 | main.ONOSbench.onosCfgSet(main.ONOSip[0], "org.onosproject.provider.nil.NullProviders", "deviceCount 35") |
| 131 | main.ONOSbench.onosCfgSet(main.ONOSip[0], "org.onosproject.provider.nil.NullProviders", "topoShape linear") |
| 132 | main.ONOSbench.onosCfgSet(main.ONOSip[0], "org.onosproject.provider.nil.NullProviders", "enabled true") |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 133 | |
| 134 | time.sleep(5) |
| 135 | main.ONOSbench.handle.sendline("onos $OC1 summary") |
| 136 | main.ONOSbench.handle.expect(":~") |
| 137 | check = main.ONOSbench.handle.before |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 138 | main.log.info("\nStart up check: \n" + check + "\n") |
| 139 | if "SCC(s)=1," in check: |
suibin zhang | a3746bf | 2015-09-05 09:36:39 -0700 | [diff] [blame] | 140 | main.ONOSbench.handle.sendline( "onos $OC1 balance-masters" ) |
suibin zhang | 45efc1b | 2015-09-04 16:48:10 -0700 | [diff] [blame] | 141 | main.ONOSbench.handle.expect( ":~" ) |
| 142 | time.sleep(5) |
| 143 | main.ONOSbench.handle.sendline( "onos $OC1 roles ") |
| 144 | main.ONOSbench.handle.expect ( ":~" ) |
| 145 | main.log.info( "switch masterships:" + str( main.ONOSbench.handle.before ) ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 146 | break |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 147 | time.sleep(5) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 148 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 149 | #devide flows |
| 150 | flows = int(main.params[ 'TEST' ][ 'flows' ]) |
| 151 | main.log.info("Flow Target = " + str(flows)) |
| 152 | |
| 153 | flows = (flows *max(int(n)+1,int(servers)))/((int(n) + 1)*int(servers)*(switches)) |
| 154 | |
| 155 | main.log.info("Flows per switch = " + str(flows)) |
| 156 | |
| 157 | #build list of servers in "$OC1, $OC2...." format |
| 158 | serverEnvVars = "" |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 159 | for i in range( int( servers ) ): |
| 160 | serverEnvVars += ( "-s " + main.ONOSip[ i ] + " " ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 161 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 162 | data = [[""]*int(servers)]*int(sampleSize) |
| 163 | maxes = [""]*int(sampleSize) |
| 164 | |
| 165 | flowCMD = "python3 " + homeDir + "/onos/tools/test/bin/" |
| 166 | flowCMD += testCMD[0] + " " + str(flows) + " " + testCMD[1] |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 167 | flowCMD += " " + str(n) + " " + str(serverEnvVars) + "-j" |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 168 | |
| 169 | main.log.info(flowCMD) |
| 170 | #time.sleep(60) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 171 | |
| 172 | for test in range(0, warmUp + sampleSize): |
| 173 | if test < warmUp: |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 174 | main.log.info("Warm up " + str(test + 1) + " of " + str(warmUp)) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 175 | else: |
| 176 | main.log.info("====== Test run: " + str(test-warmUp+1) + " ======") |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 177 | |
| 178 | main.ONOSbench.handle.sendline(flowCMD) |
| 179 | main.ONOSbench.handle.expect(":~") |
| 180 | rawResult = main.ONOSbench.handle.before |
| 181 | main.log.info("Raw results: \n" + rawResult + "\n") |
| 182 | |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 183 | if "failed" in rawResult: |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 184 | main.log.report("FLOW_TESTER.PY FAILURE") |
| 185 | main.log.report( " \n" + rawResult + " \n") |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 186 | for i in range( main.numCtrls ): |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 187 | main.log.report("=======================================================") |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 188 | main.log.report(" ONOS " + str( i + 1 ) + "LOG REPORT") |
| 189 | main.ONOSbench.logReport( main.ONOSip[ i ], ["ERROR", "WARNING", "EXCEPT"], outputMode="d" ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 190 | main.ONOSbench.handle.sendline("onos $OC1 flows") |
| 191 | main.ONOSbench.handle.expect(":~") |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 192 | main.log.info(main.ONOSbench.handle.before) |
| 193 | |
| 194 | break |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 195 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 196 | ######################################################################################## |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 197 | result = [""]*( main.numCtrls ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 198 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 199 | #print("rawResult: " + rawResult) |
| 200 | |
| 201 | rawResult = rawResult.splitlines() |
| 202 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 203 | for node in range( main.numCtrls ): |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 204 | for line in rawResult: |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 205 | #print("line: " + line) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 206 | if main.ONOSip[ node ] in line and "server" in line: |
| 207 | temp = line.split( " " ) |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 208 | for word in temp: |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 209 | #print ("word: " + word) |
| 210 | if "elapsed" in repr(word): |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 211 | index = temp.index(word) + 1 |
| 212 | myParsed = (temp[index]).replace(",","") |
| 213 | myParsed = myParsed.replace("}","") |
| 214 | myParsed = int(myParsed) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 215 | result[ node ] = myParsed |
| 216 | main.log.info( main.ONOSip[ node ] + " : " + str( myParsed ) ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 217 | break |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 218 | |
| 219 | if test >= warmUp: |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 220 | for i in result: |
| 221 | if i == "": |
cameron@onlab.us | b3aa498 | 2015-07-13 15:20:41 -0700 | [diff] [blame] | 222 | main.log.error("Missing data point, critical failure incoming") |
| 223 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 224 | print result |
| 225 | maxes[test-warmUp] = max(result) |
| 226 | main.log.info("Data collection iteration: " + str(test-warmUp) + " of " + str(sampleSize)) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 227 | main.log.info("Throughput time: " + str(maxes[test-warmUp]) + "(ms)") |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 228 | |
| 229 | data[test-warmUp] = result |
| 230 | |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 231 | # wait for flows = 0 |
| 232 | for checkCount in range(0,5): |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 233 | time.sleep(10) |
| 234 | main.ONOSbench.handle.sendline("onos $OC1 summary") |
| 235 | main.ONOSbench.handle.expect(":~") |
| 236 | flowCheck = main.ONOSbench.handle.before |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 237 | if "flows=0," in flowCheck: |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 238 | main.log.info("Flows removed") |
| 239 | break |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 240 | else: |
| 241 | for line in flowCheck.splitlines(): |
| 242 | if "flows=" in line: |
| 243 | main.log.info("Current Summary: " + line) |
| 244 | if checkCount == 2: |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 245 | main.log.info("Flows are stuck, moving on ") |
| 246 | |
| 247 | |
| 248 | time.sleep(5) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 249 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 250 | main.log.info("raw data: " + str(data)) |
| 251 | main.log.info("maxes:" + str(maxes)) |
| 252 | |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 253 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 254 | # report data |
| 255 | print("") |
| 256 | main.log.info("\t Results (measurments are in milliseconds)") |
| 257 | print("") |
| 258 | |
| 259 | nodeString = "" |
| 260 | for i in range(1, int(servers) + 1): |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 261 | nodeString += ("\tNode " + str(i)) |
| 262 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 263 | for test in range(0, sampleSize ): |
| 264 | main.log.info("\t Test iteration " + str(test + 1) ) |
| 265 | main.log.info("\t------------------") |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 266 | main.log.info(nodeString) |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 267 | resultString = "" |
| 268 | |
| 269 | for i in range(0, int(servers) ): |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 270 | resultString += ("\t" + str(data[test][i]) ) |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 271 | main.log.info(resultString) |
| 272 | |
| 273 | print("\n") |
| 274 | |
| 275 | avgOfMaxes = numpy.mean(maxes) |
| 276 | main.log.info("Average of max value from each test iteration: " + str(avgOfMaxes)) |
| 277 | |
| 278 | stdOfMaxes = numpy.std(maxes) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 279 | main.log.info("Standard Deviation of max values: " + str(stdOfMaxes)) |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 280 | print("\n\n") |
| 281 | |
| 282 | avgTP = int(main.params[ 'TEST' ][ 'flows' ]) / avgOfMaxes #result in kflows/second |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 283 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 284 | tp = [] |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 285 | for i in maxes: |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 286 | tp.append((int(main.params[ 'TEST' ][ 'flows' ]) / i )) |
| 287 | |
| 288 | stdTP = numpy.std(tp) |
| 289 | |
| 290 | main.log.info("Average thoughput: " + str(avgTP) + " Kflows/second" ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 291 | main.log.info("Standard deviation of throughput: " + str(stdTP) + " Kflows/second") |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 292 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 293 | resultsLog = open( "/tmp/flowTP1gDB", "a" ) |
| 294 | resultString = ( "'" + main.commit + "'," ) |
| 295 | resultString += ( "'1gig'," ) |
| 296 | resultString += ( (main.params[ 'TEST' ][ 'flows' ] ) + "," ) |
| 297 | resultString += ( str( main.numCtrls ) + "," ) |
| 298 | resultString += ( str( n ) + "," ) |
| 299 | resultString += ( str( avgTP ) + "," + str( stdTP ) + "\n" ) |
| 300 | resultsLog.write( resultString ) |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 301 | resultsLog.close() |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 302 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 303 | main.log.report( "Result line to file: " + resultString ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 304 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame^] | 305 | main.ONOSbench.logReport( main.ONOSip[ 0 ], [ "ERROR", "WARNING", "EXCEPT" ], outputMode="d" ) |