Jeremy Ronquillo | b27ce4c | 2017-07-17 12:41:28 -0700 | [diff] [blame] | 1 | """ |
| 2 | Copyright 2015 Open Networking Foundation (ONF) |
| 3 | |
| 4 | Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>, |
| 5 | the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>, |
| 6 | or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg> |
| 7 | |
| 8 | TestON is free software: you can redistribute it and/or modify |
| 9 | it under the terms of the GNU General Public License as published by |
| 10 | the Free Software Foundation, either version 2 of the License, or |
| 11 | (at your option) any later version. |
| 12 | |
| 13 | TestON is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
| 19 | along with TestON. If not, see <http://www.gnu.org/licenses/>. |
| 20 | """ |
| 21 | |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 22 | # SCPFintentRerouteLat |
| 23 | """ |
| 24 | SCPFintentRerouteLat |
| 25 | - Test Intent Reroute Latency |
| 26 | - Test Algorithm: |
| 27 | 1. Start Null Provider reroute Topology |
| 28 | 2. Using Push-test-intents to push batch size intents from switch 1 to switch 7 |
| 29 | 3. Cut the link between switch 3 and switch 4 (the path will reroute to switch 8) |
| 30 | 4. Get the topology time stamp |
| 31 | 5. Get Intent reroute(Installed) time stamp from each nodes |
| 32 | 6. Use the latest intent time stamp subtract topology time stamp |
| 33 | - This test will run 5 warm up by default, warm up iteration can be setup in Param file |
| 34 | - The intent batch size will default set to 1, 100, and 1000, also can be set in Param file |
| 35 | - The unit of the latency result is milliseconds |
| 36 | """ |
cameron@onlab.us | 78b8965 | 2015-07-08 15:21:03 -0700 | [diff] [blame] | 37 | |
Chiyu Cheng | ec63bde | 2016-11-17 18:11:36 -0800 | [diff] [blame] | 38 | |
cameron@onlab.us | 78b8965 | 2015-07-08 15:21:03 -0700 | [diff] [blame] | 39 | class SCPFintentRerouteLat: |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 40 | def __init__(self): |
cameron@onlab.us | 78b8965 | 2015-07-08 15:21:03 -0700 | [diff] [blame] | 41 | self.default = '' |
| 42 | |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 43 | def CASE0( self, main ): |
Chiyu Cheng | ec63bde | 2016-11-17 18:11:36 -0800 | [diff] [blame] | 44 | import imp |
| 45 | import os |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 46 | ''' |
| 47 | - GIT |
| 48 | - BUILDING ONOS |
| 49 | Pull specific ONOS branch, then Build ONOS ono ONOS Bench. |
| 50 | This step is usually skipped. Because in a Jenkins driven automated |
| 51 | test env. We want Jenkins jobs to pull&build for flexibility to handle |
| 52 | different versions of ONOS. |
| 53 | - Construct tests variables |
| 54 | ''' |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 55 | try: |
| 56 | from tests.dependencies.ONOSSetup import ONOSSetup |
| 57 | main.testSetUp = ONOSSetup() |
| 58 | except ImportError: |
| 59 | main.log.error( "ONOSSetup not found. exiting the test" ) |
| 60 | main.exit() |
| 61 | main.testSetUp.envSetupDescription() |
| 62 | stepResult = main.FALSE |
| 63 | try: |
| 64 | main.onosIp = main.ONOSbench.getOnosIps() |
| 65 | main.apps = main.params[ 'ENV' ][ 'cellApps' ] |
| 66 | main.BENCHUser = main.params[ 'BENCH' ][ 'user' ] |
| 67 | main.BENCHIp = main.params[ 'BENCH' ][ 'ip1' ] |
| 68 | main.MN1Ip = main.params[ 'MN' ][ 'ip1' ] |
| 69 | main.maxNodes = int( main.params[ 'max' ] ) |
| 70 | main.cellName = main.params[ 'ENV' ][ 'cellName' ] |
| 71 | main.scale = ( main.params[ 'SCALE' ] ).split(",") |
| 72 | main.timeout = int( main.params[ 'SLEEP' ][ 'timeout' ] ) |
| 73 | main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] ) |
| 74 | main.installSleep = int( main.params[ 'SLEEP' ][ 'install' ] ) |
| 75 | main.verifySleep = int( main.params[ 'SLEEP' ][ 'verify' ] ) |
| 76 | main.setMasterSleep = int( main.params[ 'SLEEP' ][ 'setmaster' ] ) |
| 77 | main.verifyAttempts = int( main.params[ 'ATTEMPTS' ][ 'verify' ] ) |
| 78 | main.maxInvalidRun = int( main.params[ 'ATTEMPTS' ][ 'maxInvalidRun' ] ) |
| 79 | main.sampleSize = int( main.params[ 'TEST' ][ 'sampleSize' ] ) |
| 80 | main.warmUp = int( main.params[ 'TEST' ][ 'warmUp' ] ) |
| 81 | main.ingress = main.params[ 'TEST' ][ 'ingress' ] |
| 82 | main.egress = main.params[ 'TEST' ][ 'egress' ] |
| 83 | main.debug = main.params[ 'TEST' ][ 'debug' ] |
| 84 | main.flowObj = main.params[ 'TEST' ][ 'flowObj' ] |
| 85 | main.deviceCount = int( main.params[ 'TEST' ][ 'deviceCount' ] ) |
| 86 | main.end1 = main.params[ 'TEST' ][ 'end1' ] |
| 87 | main.end2 = main.params[ 'TEST' ][ 'end2' ] |
| 88 | main.searchTerm = main.params[ 'SEARCHTERM' ] |
| 89 | if main.flowObj == "True": |
| 90 | main.flowObj = True |
| 91 | main.dbFileName = main.params[ 'DATABASE' ][ 'dbFlowObj' ] |
| 92 | main.intentsList = ( main.params[ 'TEST' ][ 'FObjintents' ] ).split( "," ) |
| 93 | else: |
| 94 | main.flowObj = False |
| 95 | main.dbFileName = main.params[ 'DATABASE' ][ 'dbName' ] |
| 96 | main.intentsList = ( main.params[ 'TEST' ][ 'intents' ] ).split( "," ) |
cameron@onlab.us | 78b8965 | 2015-07-08 15:21:03 -0700 | [diff] [blame] | 97 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 98 | stepResult = main.testSetUp.gitPulling() |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 99 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 100 | for i in range( 0, len( main.intentsList) ): |
| 101 | main.intentsList[ i ] = int( main.intentsList[ i ] ) |
| 102 | # Create DataBase file |
| 103 | main.log.info( "Create Database file " + main.dbFileName ) |
| 104 | resultsDB = open( main.dbFileName, "w+" ) |
| 105 | resultsDB.close() |
| 106 | file1 = main.params[ "DEPENDENCY" ][ "FILE1" ] |
| 107 | main.dependencyPath = os.path.dirname( os.getcwd() ) + main.params[ "DEPENDENCY" ][ "PATH" ] |
| 108 | main.intentRerouteLatFuncs = imp.load_source( file1, main.dependencyPath + file1 + ".py" ) |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 109 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 110 | main.record = 0 |
| 111 | except Exception as e: |
| 112 | main.testSetUp.envSetupException( e ) |
| 113 | main.testSetUp.evnSetupConclusion( stepResult ) |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 114 | |
| 115 | def CASE1( self, main ): |
| 116 | ''' |
| 117 | clean up test environment and set up |
| 118 | ''' |
cameron@onlab.us | 78b8965 | 2015-07-08 15:21:03 -0700 | [diff] [blame] | 119 | import time |
| 120 | |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 121 | main.maxNumBatch = 0 |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 122 | main.testSetUp.getNumCtrls( True ) |
| 123 | main.testSetUp.envSetup( includeGitPull=False, makeMaxNodes=False ) |
| 124 | main.testSetUp.ONOSSetUp( main.MN1Ip, True, |
| 125 | cellName=main.cellName, killRemoveMax=False, |
| 126 | CtrlsSet=False ) |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 127 | # configure apps |
You Wang | 227baa9 | 2017-07-24 11:21:28 -0700 | [diff] [blame] | 128 | main.CLIs[ 0 ].setCfg( "org.onosproject.provider.nil.NullProviders", "deviceCount", value=main.deviceCount ) |
| 129 | main.CLIs[ 0 ].setCfg( "org.onosproject.provider.nil.NullProviders", "topoShape", value="reroute" ) |
| 130 | main.CLIs[ 0 ].setCfg( "org.onosproject.provider.nil.NullProviders", "enabled", value="true" ) |
| 131 | main.CLIs[ 0 ].setCfg( "org.onosproject.net.intent.impl.IntentManager", "skipReleaseResourcesOnWithdrawal", value="true" ) |
YPZhang | e6ef82a | 2016-07-05 16:48:15 -0700 | [diff] [blame] | 132 | if main.flowObj: |
You Wang | 227baa9 | 2017-07-24 11:21:28 -0700 | [diff] [blame] | 133 | main.CLIs[ 0 ].setCfg( "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator", |
| 134 | "useFlowObjectives", value="true" ) |
| 135 | main.CLIs[ 0 ].setCfg( "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator", |
You Wang | 106d0fa | 2017-05-15 17:22:15 -0700 | [diff] [blame] | 136 | "defaultFlowObjectiveCompiler", |
You Wang | 227baa9 | 2017-07-24 11:21:28 -0700 | [diff] [blame] | 137 | value='org.onosproject.net.intent.impl.compiler.LinkCollectionIntentObjectiveCompiler' ) |
Chiyu Cheng | ec63bde | 2016-11-17 18:11:36 -0800 | [diff] [blame] | 138 | time.sleep( main.startUpSleep ) |
| 139 | for i in range( int( main.numCtrls ) ): |
| 140 | main.CLIs[i].logSet( "DEBUG", "org.onosproject.metrics.topology" ) |
| 141 | main.CLIs[i].logSet( "DEBUG", "org.onosproject.metrics.intent" ) |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 142 | # Balance Master |
| 143 | main.CLIs[0].balanceMasters() |
You Wang | 0b9039d | 2017-01-12 16:51:29 -0800 | [diff] [blame] | 144 | time.sleep( main.setMasterSleep ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 145 | if main.numCtrls: |
| 146 | main.CLIs[0].deviceRole( main.end1[ 'name' ], main.ONOSip[0] ) |
| 147 | main.CLIs[0].deviceRole( main.end2[ 'name' ], main.ONOSip[0] ) |
YPZhang | 2b9b26d | 2016-06-20 16:18:29 -0700 | [diff] [blame] | 148 | time.sleep( main.setMasterSleep ) |
cameron@onlab.us | 78b8965 | 2015-07-08 15:21:03 -0700 | [diff] [blame] | 149 | |
| 150 | def CASE2( self, main ): |
cameron@onlab.us | 78b8965 | 2015-07-08 15:21:03 -0700 | [diff] [blame] | 151 | import time |
| 152 | import numpy |
| 153 | import datetime |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 154 | import json |
| 155 | # from scipy import stats |
cameron@onlab.us | 78b8965 | 2015-07-08 15:21:03 -0700 | [diff] [blame] | 156 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 157 | print( main.intentsList) |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 158 | for batchSize in main.intentsList: |
You Wang | 0b9039d | 2017-01-12 16:51:29 -0800 | [diff] [blame] | 159 | main.batchSize = batchSize |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 160 | main.log.report("Intent Batch size: " + str(batchSize) + "\n ") |
You Wang | 6d301d4 | 2017-04-21 10:49:33 -0700 | [diff] [blame] | 161 | firstLocalLatencies = [] |
| 162 | lastLocalLatencies = [] |
| 163 | firstGlobalLatencies = [] |
| 164 | lastGlobalLatencies = [] |
| 165 | main.startLine = {} |
Chiyu Cheng | ec63bde | 2016-11-17 18:11:36 -0800 | [diff] [blame] | 166 | main.validRun = 0 |
| 167 | main.invalidRun = 0 |
You Wang | 0b9039d | 2017-01-12 16:51:29 -0800 | [diff] [blame] | 168 | while main.validRun <= main.warmUp + main.sampleSize and main.invalidRun <= main.maxInvalidRun: |
Chiyu Cheng | ec63bde | 2016-11-17 18:11:36 -0800 | [diff] [blame] | 169 | if main.validRun >= main.warmUp: |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 170 | main.log.info("================================================") |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 171 | main.log.info("Valid iteration: {} ".format( main.validRun - main.warmUp) ) |
| 172 | main.log.info("Total iteration: {}".format( main.validRun + main.invalidRun) ) |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 173 | main.log.info("================================================") |
cameron@onlab.us | 78b8965 | 2015-07-08 15:21:03 -0700 | [diff] [blame] | 174 | else: |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 175 | main.log.info("====================Warm Up=====================") |
cameron@onlab.us | 78b8965 | 2015-07-08 15:21:03 -0700 | [diff] [blame] | 176 | |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 177 | # push intents |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 178 | main.CLIs[0].pushTestIntents( main.ingress, main.egress, main.batchSize, |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 179 | offset=1, options="-i", timeout=main.timeout) |
cameron@onlab.us | 78b8965 | 2015-07-08 15:21:03 -0700 | [diff] [blame] | 180 | |
You Wang | 6d301d4 | 2017-04-21 10:49:33 -0700 | [diff] [blame] | 181 | # check links, flows and intents |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 182 | main.intentRerouteLatFuncs.sanityCheck( main, main.deviceCount * 2, batchSize * ( main.deviceCount - 1 ), main.batchSize ) |
Chiyu Cheng | ec63bde | 2016-11-17 18:11:36 -0800 | [diff] [blame] | 183 | if not main.verify: |
You Wang | 6d301d4 | 2017-04-21 10:49:33 -0700 | [diff] [blame] | 184 | main.log.warn( "Sanity check failed, skipping this iteration..." ) |
| 185 | continue |
| 186 | |
| 187 | # Insert one line in karaf.log before link down |
| 188 | for i in range( main.numCtrls ): |
| 189 | main.CLIs[ i ].log( "\'Scale: {}, Batch:{}, Iteration: {}\'".format( main.numCtrls, batchSize, main.validRun + main.invalidRun ) ) |
| 190 | |
| 191 | # bring link down |
Chiyu Cheng | 1976db5 | 2016-10-21 15:57:30 -0700 | [diff] [blame] | 192 | main.CLIs[0].link( main.end1[ 'port' ], main.end2[ 'port' ], "down", |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 193 | timeout=main.timeout, showResponse=False) |
You Wang | 6d301d4 | 2017-04-21 10:49:33 -0700 | [diff] [blame] | 194 | |
| 195 | # check links, flows and intents |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 196 | main.intentRerouteLatFuncs.sanityCheck( main, ( main.deviceCount - 1) * 2, batchSize * main.deviceCount, main.batchSize ) |
Chiyu Cheng | ec63bde | 2016-11-17 18:11:36 -0800 | [diff] [blame] | 197 | if not main.verify: |
You Wang | 6d301d4 | 2017-04-21 10:49:33 -0700 | [diff] [blame] | 198 | main.log.warn( "Sanity check failed, skipping this iteration..." ) |
| 199 | continue |
| 200 | |
| 201 | # Get timestamp of last LINK_REMOVED event as separator between iterations |
| 202 | skip = False |
Chiyu Cheng | ec63bde | 2016-11-17 18:11:36 -0800 | [diff] [blame] | 203 | for i in range( main.numCtrls ): |
You Wang | 6d301d4 | 2017-04-21 10:49:33 -0700 | [diff] [blame] | 204 | logNum = main.intentRerouteLatFuncs.getLogNum( main, i ) |
| 205 | timestamp = str( main.CLIs[ i ].getTimeStampFromLog( "last", "LINK_REMOVED", "time = ", " ", logNum=logNum ) ) |
| 206 | if timestamp == main.ERROR: |
| 207 | # Try again in case that the log number just increased |
| 208 | logNum = main.intentRerouteLatFuncs.getLogNum( main, i ) |
| 209 | timestamp = str( main.CLIs[ i ].getTimeStampFromLog( "last", "LINK_REMOVED", "time = ", " ", logNum=logNum ) ) |
| 210 | if timestamp == main.ERROR: |
| 211 | main.log.warn( "Cannot find the event we want in the log, skipping this iteration..." ) |
| 212 | main.intentRerouteLatFuncs.bringBackTopology( main ) |
| 213 | if main.validRun >= main.warmUp: |
| 214 | main.invalidRun += 1 |
| 215 | else: |
| 216 | main.validRun += 1 |
| 217 | skip = True |
| 218 | break |
| 219 | else: |
| 220 | main.startLine[ i ] = timestamp |
| 221 | main.log.info( "Timestamp of last LINK_REMOVED event on node {} is {}".format( i+1, main.startLine[ i ] ) ) |
| 222 | if skip: continue |
| 223 | |
| 224 | # calculate values |
| 225 | topologyTimestamps = main.intentRerouteLatFuncs.getTopologyTimestamps( main ) |
| 226 | intentTimestamps = main.intentRerouteLatFuncs.getIntentTimestamps( main ) |
| 227 | if intentTimestamps == main.ERROR or topologyTimestamps == main.ERROR: |
| 228 | main.log.info( "Got invalid timestamp, skipping this iteration..." ) |
| 229 | main.intentRerouteLatFuncs.bringBackTopology( main ) |
Chiyu Cheng | ec63bde | 2016-11-17 18:11:36 -0800 | [diff] [blame] | 230 | if main.validRun >= main.warmUp: |
| 231 | main.invalidRun += 1 |
YPZhang | 8742d2e | 2016-06-16 15:31:58 -0700 | [diff] [blame] | 232 | else: |
Chiyu Cheng | ec63bde | 2016-11-17 18:11:36 -0800 | [diff] [blame] | 233 | main.validRun += 1 |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 234 | continue |
Chiyu Cheng | ec63bde | 2016-11-17 18:11:36 -0800 | [diff] [blame] | 235 | else: |
You Wang | 6d301d4 | 2017-04-21 10:49:33 -0700 | [diff] [blame] | 236 | main.log.info( "Got valid timestamps" ) |
| 237 | |
| 238 | firstLocalLatnecy, lastLocalLatnecy, firstGlobalLatency, lastGlobalLatnecy = main.intentRerouteLatFuncs.calculateLatency( main, topologyTimestamps, intentTimestamps ) |
| 239 | if firstLocalLatnecy < 0: |
| 240 | main.log.info( "Got negative latency, skipping this iteration..." ) |
| 241 | main.intentRerouteLatFuncs.bringBackTopology( main ) |
| 242 | if main.validRun >= main.warmUp: |
| 243 | main.invalidRun += 1 |
| 244 | else: |
| 245 | main.validRun += 1 |
| 246 | continue |
| 247 | else: |
| 248 | main.log.info( "Got valid latencies" ) |
Chiyu Cheng | ec63bde | 2016-11-17 18:11:36 -0800 | [diff] [blame] | 249 | main.validRun += 1 |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 250 | |
You Wang | 6d301d4 | 2017-04-21 10:49:33 -0700 | [diff] [blame] | 251 | firstLocalLatencies.append( firstLocalLatnecy ) |
| 252 | lastLocalLatencies.append( lastLocalLatnecy ) |
| 253 | firstGlobalLatencies.append( firstGlobalLatency ) |
| 254 | lastGlobalLatencies.append( lastGlobalLatnecy ) |
| 255 | |
| 256 | # bring up link and withdraw intents |
Chiyu Cheng | 1976db5 | 2016-10-21 15:57:30 -0700 | [diff] [blame] | 257 | main.CLIs[0].link( main.end1[ 'port' ], main.end2[ 'port' ], "up", |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 258 | timeout=main.timeout) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 259 | main.CLIs[0].pushTestIntents( main.ingress, main.egress, batchSize, |
You Wang | 6d301d4 | 2017-04-21 10:49:33 -0700 | [diff] [blame] | 260 | offset=1, options="-w", timeout=main.timeout) |
| 261 | main.CLIs[0].purgeWithdrawnIntents() |
| 262 | |
| 263 | # check links, flows and intents |
| 264 | main.intentRerouteLatFuncs.sanityCheck( main, main.deviceCount * 2, 0, 0 ) |
Chiyu Cheng | ec63bde | 2016-11-17 18:11:36 -0800 | [diff] [blame] | 265 | if not main.verify: |
YPZhang | febf730 | 2016-05-24 16:45:56 -0700 | [diff] [blame] | 266 | continue |
| 267 | |
You Wang | 6d301d4 | 2017-04-21 10:49:33 -0700 | [diff] [blame] | 268 | aveLocalLatency = numpy.average( lastLocalLatencies ) |
| 269 | aveGlobalLatency = numpy.average( lastGlobalLatencies ) |
| 270 | stdLocalLatency = numpy.std( lastLocalLatencies ) |
| 271 | stdGlobalLatency = numpy.std( lastGlobalLatencies ) |
Chiyu Cheng | ec63bde | 2016-11-17 18:11:36 -0800 | [diff] [blame] | 272 | |
| 273 | main.log.report( "Scale: " + str( main.numCtrls ) + " \tIntent batch: " + str( batchSize ) ) |
You Wang | 6d301d4 | 2017-04-21 10:49:33 -0700 | [diff] [blame] | 274 | main.log.report( "Local latency average:................" + str( aveLocalLatency ) ) |
| 275 | main.log.report( "Global latency average:................" + str( aveGlobalLatency ) ) |
| 276 | main.log.report( "Local latency std:................" + str( stdLocalLatency ) ) |
| 277 | main.log.report( "Global latency std:................" + str( stdGlobalLatency ) ) |
Chiyu Cheng | ec63bde | 2016-11-17 18:11:36 -0800 | [diff] [blame] | 278 | main.log.report( "________________________________________________________" ) |
cameron@onlab.us | 78b8965 | 2015-07-08 15:21:03 -0700 | [diff] [blame] | 279 | |
You Wang | 6d301d4 | 2017-04-21 10:49:33 -0700 | [diff] [blame] | 280 | if not ( numpy.isnan( aveLocalLatency ) or numpy.isnan( aveGlobalLatency ) ): |
YPZhang | 8742d2e | 2016-06-16 15:31:58 -0700 | [diff] [blame] | 281 | # check if got NaN for result |
You Wang | 6d301d4 | 2017-04-21 10:49:33 -0700 | [diff] [blame] | 282 | resultsDB = open( main.dbFileName, "a" ) |
| 283 | resultsDB.write( "'" + main.commit + "'," ) |
| 284 | resultsDB.write( str( main.numCtrls ) + "," ) |
| 285 | resultsDB.write( str( batchSize ) + "," ) |
| 286 | resultsDB.write( str( aveLocalLatency ) + "," ) |
| 287 | resultsDB.write( str( stdLocalLatency ) + "\n" ) |
YPZhang | 8742d2e | 2016-06-16 15:31:58 -0700 | [diff] [blame] | 288 | resultsDB.close() |