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 | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 22 | ''' |
| 23 | SCPFswitchLat |
| 24 | Test Switch add/remove latency |
| 25 | calculate package latency between switch and ONOS |
| 26 | Switch UP: |
| 27 | TCP -- Feature Reply -- Role Request -- Role Reply -- Device -- Graph |
| 28 | Siwtch Down: |
| 29 | Openflow FIN/ACK -- ACK -- Device -- Graph |
| 30 | ''' |
cameron@onlab.us | 21106ea | 2015-07-23 15:32:51 -0700 | [diff] [blame] | 31 | |
| 32 | class SCPFswitchLat: |
| 33 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 34 | def __init__(self): |
cameron@onlab.us | 21106ea | 2015-07-23 15:32:51 -0700 | [diff] [blame] | 35 | self.default = '' |
| 36 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 37 | def CASE0( self, main ): |
cameron@onlab.us | 21106ea | 2015-07-23 15:32:51 -0700 | [diff] [blame] | 38 | import os |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 39 | import imp |
| 40 | ''' |
| 41 | - GIT |
| 42 | - BUILDING ONOS |
| 43 | Pull specific ONOS branch, then Build ONOS ono ONOS Bench. |
| 44 | This step is usually skipped. Because in a Jenkins driven automated |
| 45 | test env. We want Jenkins jobs to pull&build for flexibility to handle |
| 46 | different versions of ONOS. |
| 47 | - Construct tests variables |
| 48 | ''' |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 49 | try: |
| 50 | from tests.dependencies.ONOSSetup import ONOSSetup |
| 51 | main.testSetUp = ONOSSetup() |
| 52 | except ImportError: |
| 53 | main.log.error( "ONOSSetup not found. exiting the test" ) |
| 54 | main.exit() |
| 55 | main.testSetUp.envSetupDescription() |
| 56 | stepResult = main.FALSE |
| 57 | try: |
| 58 | # The dictionary to record different type of wrongs |
| 59 | main.wrong = { 'totalWrong': 0, 'skipDown' : 0, 'TsharkValueIncorrect': 0, |
| 60 | 'TypeError' : 0, 'decodeJasonError': 0, |
| 61 | 'checkResultIncorrect': 0} |
| 62 | main.maxWrong = int( main.params['TEST'] ['MaxWrong'] ) |
| 63 | main.resultRange = main.params['TEST']['ResultRange'] |
| 64 | main.searchTerm = main.params['TEST']['SearchTerm'] |
| 65 | main.MN1Ip = main.params['MN']['ip1'] |
| 66 | main.dependencyPath = main.testOnDirectory + \ |
| 67 | main.params['DEPENDENCY']['path'] |
| 68 | main.topoName = main.params['DEPENDENCY']['topology'] |
| 69 | main.dependencyFunc = main.params['DEPENDENCY']['function'] |
| 70 | main.cellName = main.params['ENV']['cellName'] |
| 71 | main.apps = main.params['ENV']['cellApps'] |
| 72 | main.scale = (main.params['SCALE']).split(",") |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 73 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 74 | main.ofPackage = main.params['TSHARK'] |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 75 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 76 | main.tsharkResultPath = main.params['TEST']['tsharkResultPath'] |
| 77 | main.sampleSize = int(main.params['TEST']['sampleSize']) |
| 78 | main.warmUp = int(main.params['TEST']['warmUp']) |
| 79 | main.dbFileName = main.params['DATABASE']['dbName'] |
| 80 | main.startUpSleep = int(main.params['SLEEP']['startup']) |
| 81 | main.measurementSleep = int( main.params['SLEEP']['measure'] ) |
| 82 | main.deleteSwSleep = int( main.params['SLEEP']['deleteSW'] ) |
| 83 | main.maxScale = int( main.params['max'] ) |
| 84 | main.timeout = int( main.params['TIMEOUT']['timeout'] ) |
| 85 | main.MNSleep = int( main.params['SLEEP']['mininet']) |
| 86 | main.device = main.params['TEST']['device'] |
| 87 | stepResult = main.testSetUp.gitPulling() |
| 88 | main.log.info("Create Database file " + main.dbFileName) |
| 89 | resultsDB = open(main.dbFileName, "w+") |
| 90 | resultsDB.close() |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 91 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 92 | main.switchFunc = imp.load_source(main.dependencyFunc, |
| 93 | main.dependencyPath + |
| 94 | main.dependencyFunc + |
| 95 | ".py") |
| 96 | except Exception as e: |
| 97 | main.testSetUp.envSetupException( e ) |
| 98 | main.testSetUp.evnSetupConclusion( stepResult ) |
| 99 | main.commit = main.commit.split( " " )[ 1 ] |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 100 | def CASE1(self, main): |
| 101 | # Clean up test environment and set up |
cameron@onlab.us | 21106ea | 2015-07-23 15:32:51 -0700 | [diff] [blame] | 102 | import time |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 103 | try: |
| 104 | from tests.dependencies.utils import Utils |
| 105 | except ImportError: |
| 106 | main.log.error( "Utils not found exiting the test" ) |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 107 | main.exit() |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 108 | try: |
| 109 | main.Utils |
| 110 | except ( NameError, AttributeError ): |
| 111 | main.Utils = Utils() |
| 112 | main.maxNumBatch = 0 |
| 113 | main.testSetUp.getNumCtrls( True ) |
| 114 | main.testSetUp.envSetup( includeGitPull=False, makeMaxNodes=False ) |
| 115 | main.testSetUp.ONOSSetUp( main.Mininet1, True, |
| 116 | cellName=main.cellName, killRemoveMax=False, |
| 117 | CtrlsSet=False ) |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 118 | |
| 119 | main.log.info("Configure apps") |
| 120 | main.CLIs[0].setCfg("org.onosproject.net.topology.impl.DefaultTopologyProvider", |
| 121 | "maxEvents 1") |
| 122 | main.CLIs[0].setCfg("org.onosproject.net.topology.impl.DefaultTopologyProvider", |
| 123 | "maxBatchMs 0") |
| 124 | main.CLIs[0].setCfg("org.onosproject.net.topology.impl.DefaultTopologyProvider", |
| 125 | "maxIdleMs 0") |
chengchiyu | 08303a0 | 2016-09-08 17:40:26 -0700 | [diff] [blame] | 126 | for i in range(main.numCtrls): |
| 127 | main.CLIs[i].logSet( "DEBUG", "org.onosproject.metrics.topology") |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 128 | time.sleep(1) |
| 129 | |
| 130 | main.log.info("Copy topology file to Mininet") |
| 131 | main.ONOSbench.copyMininetFile(main.topoName, |
| 132 | main.dependencyPath, |
| 133 | main.Mininet1.user_name, |
| 134 | main.Mininet1.ip_address) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 135 | main.Utils.mininetCleanup( main.Mininet1 ) |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 136 | time.sleep(main.MNSleep) |
| 137 | main.log.info("Start new mininet topology") |
cameron@onlab.us | 21106ea | 2015-07-23 15:32:51 -0700 | [diff] [blame] | 138 | main.Mininet1.startNet() |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 139 | main.log.info("Assign switch to controller to ONOS node 1") |
cameron@onlab.us | 21106ea | 2015-07-23 15:32:51 -0700 | [diff] [blame] | 140 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 141 | time.sleep(2) |
cameron@onlab.us | 21106ea | 2015-07-23 15:32:51 -0700 | [diff] [blame] | 142 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 143 | def CASE2(self,main): |
cameron@onlab.us | 21106ea | 2015-07-23 15:32:51 -0700 | [diff] [blame] | 144 | import time |
cameron@onlab.us | 21106ea | 2015-07-23 15:32:51 -0700 | [diff] [blame] | 145 | import json |
cameron@onlab.us | 21106ea | 2015-07-23 15:32:51 -0700 | [diff] [blame] | 146 | import numpy |
| 147 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 148 | resultDict = {'up' : {}, 'down' : {}} |
| 149 | for i in range(1, main.numCtrls + 1): |
| 150 | resultDict['up'][ 'node' + str(i) ] = {} |
| 151 | resultDict['up'][ 'node' + str(i) ][ 'Ave' ] = {} |
| 152 | resultDict['up'][ 'node' + str(i) ][ 'Std' ] = {} |
| 153 | resultDict['up'][ 'node' + str(i) ][ 'T_F' ] = []#TCP to Feature |
| 154 | resultDict['up'][ 'node' + str(i) ][ 'F_R' ] = []#Feature to Role |
| 155 | resultDict['up'][ 'node' + str(i) ][ 'RQ_RR' ] = []#role request to role reply |
| 156 | resultDict['up'][ 'node' + str(i) ][ 'RR_D' ] = []#role reply to Device |
| 157 | resultDict['up'][ 'node' + str(i) ][ 'D_G' ] = []#Device to Graph |
| 158 | resultDict['up'][ 'node' + str(i) ][ 'E_E' ] = []#TCP to Graph |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 159 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 160 | for i in range(1,main.numCtrls + 1): |
| 161 | resultDict['down'][ 'node' + str(i) ] = {} |
| 162 | resultDict['down'][ 'node' + str(i) ][ 'Ave' ] = {} |
| 163 | resultDict['down'][ 'node' + str(i) ][ 'Std' ] = {} |
| 164 | resultDict['down'][ 'node' + str(i) ][ 'FA_A' ] = []#Fin_ack to ACK |
| 165 | resultDict['down'][ 'node' + str(i) ][ 'A_D' ] = []#Ack to Device |
| 166 | resultDict['down'][ 'node' + str(i) ][ 'D_G' ] = []#Device to Graph |
| 167 | resultDict['down'][ 'node' + str(i) ][ 'E_E' ] = []#fin_ack to Graph |
| 168 | for i in range(1 , main.sampleSize + main.warmUp): |
| 169 | main.log.info("************************************************************") |
| 170 | main.log.info("************************ Iteration: {} **********************" .format(str( i )) ) |
| 171 | if i < main.warmUp: |
| 172 | main.switchFunc.captureOfPack( main, main.device, main.ofPackage, |
| 173 | "up", resultDict, True ) |
| 174 | main.switchFunc.captureOfPack( main, main.device, main.ofPackage, |
| 175 | "down", resultDict, True ) |
chengchiyu | 08303a0 | 2016-09-08 17:40:26 -0700 | [diff] [blame] | 176 | main.CLIs[0].removeDevice( "of:0000000000000001" ) |
cameron@onlab.us | 21106ea | 2015-07-23 15:32:51 -0700 | [diff] [blame] | 177 | else: |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 178 | main.switchFunc.captureOfPack( main, main.device, main.ofPackage, |
| 179 | "up", resultDict, False ) |
| 180 | main.switchFunc.captureOfPack (main, main.device, main.ofPackage, |
| 181 | "down", resultDict, False ) |
chengchiyu | 08303a0 | 2016-09-08 17:40:26 -0700 | [diff] [blame] | 182 | main.CLIs[0].removeDevice( "of:0000000000000001" ) |
| 183 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 184 | # Dictionary for result |
| 185 | maxDict = {} |
| 186 | maxDict['down'] = {} |
| 187 | maxDict['up'] = {} |
| 188 | maxDict['down']['max'] = 0 |
| 189 | maxDict['up']['max'] = 0 |
| 190 | maxDict['down']['node'] = 0 |
| 191 | maxDict['up']['node'] = 0 |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 192 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 193 | for i in range(1, main.numCtrls + 1): |
| 194 | # calculate average and std for result, and grep the max End to End data |
| 195 | EtoEtemp = numpy.average( resultDict['up'][ 'node' + str(i) ]['E_E'] ) |
| 196 | resultDict['up'][ 'node' + str(i) ][ 'Ave' ][ 'E_E' ] = EtoEtemp |
| 197 | if maxDict['up']['max'] < EtoEtemp: |
| 198 | # get max End to End latency |
| 199 | maxDict['up']['max'] = EtoEtemp |
| 200 | maxDict['up']['node'] = i |
| 201 | resultDict['up']['node' + str(i)]['Ave']['T_F'] = numpy.average(resultDict['up']['node' + str(i)]['T_F']) |
| 202 | resultDict['up']['node' + str(i)]['Ave']['F_R'] = numpy.average(resultDict['up']['node' + str(i)]['F_R']) |
| 203 | resultDict['up']['node' + str(i)]['Ave']['RQ_RR'] = numpy.average(resultDict['up']['node' + str(i)]['RQ_RR']) |
| 204 | resultDict['up']['node' + str(i)]['Ave']['RR_D'] = numpy.average(resultDict['up']['node' + str(i)]['RR_D']) |
| 205 | resultDict['up']['node' + str(i)]['Ave']['D_G'] = numpy.average(resultDict['up']['node' + str(i)]['D_G']) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 206 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 207 | resultDict['up'][ 'node' + str(i) ][ 'Std' ][ 'E_E' ] = numpy.std( resultDict['up'][ 'node' + str(i) ]['E_E'] ) |
| 208 | resultDict['up']['node' + str(i)]['Std']['T_F'] = numpy.std(resultDict['up']['node' + str(i)]['T_F']) |
| 209 | resultDict['up']['node' + str(i)]['Std']['F_R'] = numpy.std(resultDict['up']['node' + str(i)]['F_R']) |
| 210 | resultDict['up']['node' + str(i)]['Std']['RQ_RR'] = numpy.std(resultDict['up']['node' + str(i)]['RQ_RR']) |
| 211 | resultDict['up']['node' + str(i)]['Std']['RR_D'] = numpy.std(resultDict['up']['node' + str(i)]['RR_D']) |
| 212 | resultDict['up']['node' + str(i)]['Std']['D_G'] = numpy.std(resultDict['up']['node' + str(i)]['D_G']) |
cameron@onlab.us | 21106ea | 2015-07-23 15:32:51 -0700 | [diff] [blame] | 213 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 214 | # calculate average and std for result, and grep the max End to End data |
| 215 | EtoEtemp = numpy.average( resultDict['down'][ 'node' + str(i) ]['E_E'] ) |
| 216 | resultDict['down'][ 'node' + str(i) ][ 'Ave' ][ 'E_E' ] = EtoEtemp |
| 217 | if maxDict['down']['max'] < EtoEtemp: |
| 218 | # get max End to End latency |
| 219 | maxDict['down']['max'] = EtoEtemp |
| 220 | maxDict['down']['node'] = i |
| 221 | resultDict['down']['node' + str(i)]['Ave']['FA_A'] = numpy.average(resultDict['down']['node' + str(i)]['FA_A']) |
| 222 | resultDict['down']['node' + str(i)]['Ave']['A_D'] = numpy.average(resultDict['down']['node' + str(i)]['A_D']) |
| 223 | resultDict['down']['node' + str(i)]['Ave']['D_G'] = numpy.average(resultDict['down']['node' + str(i)]['D_G']) |
cameron@onlab.us | 21106ea | 2015-07-23 15:32:51 -0700 | [diff] [blame] | 224 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 225 | resultDict['down'][ 'node' + str(i) ][ 'Std' ][ 'E_E' ] = numpy.std( resultDict['down'][ 'node' + str(i) ]['E_E'] ) |
| 226 | resultDict['down']['node' + str(i)]['Std']['FA_A'] = numpy.std(resultDict['down']['node' + str(i)]['FA_A']) |
| 227 | resultDict['down']['node' + str(i)]['Std']['A_D'] = numpy.std(resultDict['down']['node' + str(i)]['A_D']) |
| 228 | resultDict['down']['node' + str(i)]['Std']['D_G'] = numpy.std(resultDict['down']['node' + str(i)]['D_G']) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 229 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 230 | main.log.report( "=====node{} Summary:=====".format( str(i) ) ) |
| 231 | main.log.report( "=============Switch up=======" ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 232 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 233 | main.log.report( |
| 234 | "End to End average: {}".format( str(resultDict["up"][ 'node' + str(i) ][ 'Ave' ][ 'E_E' ]) ) ) |
| 235 | main.log.report( |
| 236 | "End to End Std: {}".format( str(resultDict["up"][ 'node' + str(i) ][ 'Std' ][ 'E_E' ]) ) ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 237 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 238 | main.log.report( |
| 239 | "TCP to Feature average: {}".format( str(resultDict["up"][ 'node' + str(i) ][ 'Ave' ][ 'T_F' ]) ) ) |
| 240 | main.log.report( |
| 241 | "TCP to Feature Std: {}".format( str(resultDict["up"][ 'node' + str(i) ][ 'Std' ][ 'T_F' ]) ) ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 242 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 243 | main.log.report( |
| 244 | "Feature to Role average: {}".format( str(resultDict["up"][ 'node' + str(i) ][ 'Ave' ][ 'F_R' ]) ) ) |
| 245 | main.log.report( |
| 246 | "Feature to Role Std: {}".format( str(resultDict["up"][ 'node' + str(i) ][ 'Std' ][ 'F_R' ]) ) ) |
cameron@onlab.us | 21106ea | 2015-07-23 15:32:51 -0700 | [diff] [blame] | 247 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 248 | main.log.report( |
| 249 | "Role request to Role reply average: {}".format( str(resultDict["up"][ 'node' + str(i) ][ 'Ave' ][ 'RQ_RR' ]) ) ) |
| 250 | main.log.report( |
| 251 | "Role request to Role reply Std: {}".format( str(resultDict["up"][ 'node' + str(i) ][ 'Std' ][ 'RQ_RR' ]) ) ) |
cameron@onlab.us | 21106ea | 2015-07-23 15:32:51 -0700 | [diff] [blame] | 252 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 253 | main.log.report( |
| 254 | "Role reply to Device average: {}".format( str(resultDict["up"][ 'node' + str(i) ][ 'Ave' ][ 'RR_D' ]) ) ) |
| 255 | main.log.report( |
| 256 | "Role reply to Device Std: {}".format( str(resultDict["up"][ 'node' + str(i) ][ 'Std' ][ 'RR_D' ]) ) ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 257 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 258 | main.log.report( |
| 259 | "Device to Graph average: {}".format( str(resultDict["up"][ 'node' + str(i) ][ 'Ave' ][ 'D_G' ]) ) ) |
| 260 | main.log.report( |
| 261 | "Device to Graph Std: {}".format( str(resultDict["up"][ 'node' + str(i) ][ 'Std' ][ 'D_G' ]) ) ) |
cameron@onlab.us | 21106ea | 2015-07-23 15:32:51 -0700 | [diff] [blame] | 262 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 263 | main.log.report( "=============Switch down=======" ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 264 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 265 | main.log.report( |
| 266 | "End to End average: {}".format( str(resultDict["down"][ 'node' + str(i) ][ 'Ave' ][ 'E_E' ]) ) ) |
| 267 | main.log.report( |
| 268 | "End to End Std: {}".format( str(resultDict["down"][ 'node' + str(i) ][ 'Std' ][ 'E_E' ]) ) ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 269 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 270 | main.log.report( |
| 271 | "Fin_ACK to ACK average: {}".format( str(resultDict["down"][ 'node' + str(i) ][ 'Ave' ][ 'FA_A' ]) ) ) |
| 272 | main.log.report( |
| 273 | "Fin_ACK to ACK Std: {}".format( str(resultDict["down"][ 'node' + str(i) ][ 'Std' ][ 'FA_A' ]) ) ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 274 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 275 | main.log.report( |
| 276 | "ACK to Device average: {}".format( str(resultDict["down"][ 'node' + str(i) ][ 'Ave' ][ 'A_D' ]) ) ) |
| 277 | main.log.report( |
| 278 | "ACK to Device Std: {}".format( str(resultDict["down"][ 'node' + str(i) ][ 'Std' ][ 'A_D' ]) ) ) |
cameron@onlab.us | 21106ea | 2015-07-23 15:32:51 -0700 | [diff] [blame] | 279 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 280 | main.log.report( |
| 281 | "Device to Graph average: {}".format( str(resultDict["down"][ 'node' + str(i) ][ 'Ave' ][ 'D_G' ]) ) ) |
| 282 | main.log.report( |
| 283 | "Device to Graph Std: {}".format( str(resultDict["down"][ 'node' + str(i) ][ 'Std' ][ 'D_G' ]) ) ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 284 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 285 | with open(main.dbFileName, "a") as dbFile: |
| 286 | # TODO: Save STD to Database |
| 287 | # Scale number |
| 288 | temp = str(main.numCtrls) |
| 289 | temp += ",'baremetal1'" |
| 290 | # put result |
| 291 | temp += "," + str( "%.2f" % resultDict['up'][ 'node' + str(maxDict['up']['node']) ][ 'Ave' ][ 'E_E' ] ) |
| 292 | temp += "," + str( "%.2f" % resultDict['up'][ 'node' + str(maxDict['up']['node']) ][ 'Ave' ][ 'T_F' ] ) |
| 293 | temp += "," + str( "%.2f" % resultDict['up'][ 'node' + str(maxDict['up']['node']) ][ 'Ave' ][ 'F_R' ] ) |
| 294 | temp += "," + str( "%.2f" % resultDict['up'][ 'node' + str(maxDict['up']['node']) ][ 'Ave' ][ 'RQ_RR' ] ) |
| 295 | temp += "," + str( "%.2f" % resultDict['up'][ 'node' + str(maxDict['up']['node']) ][ 'Ave' ][ 'RR_D' ] ) |
| 296 | temp += "," + str( "%.2f" % resultDict['up'][ 'node' + str(maxDict['up']['node']) ][ 'Ave' ][ 'D_G' ] ) |
cameron@onlab.us | 21106ea | 2015-07-23 15:32:51 -0700 | [diff] [blame] | 297 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 298 | temp += "," + str( "%.2f" % resultDict['down'][ 'node' + str(maxDict['down']['node']) ][ 'Ave' ][ 'E_E' ] ) |
| 299 | temp += "," + str( "%.2f" % resultDict['down'][ 'node' + str(maxDict['down']['node']) ][ 'Ave' ][ 'FA_A' ] ) |
| 300 | temp += "," + str( "%.2f" % resultDict['down'][ 'node' + str(maxDict['down']['node']) ][ 'Ave' ][ 'A_D' ] ) |
| 301 | temp += "," + str( "%.2f" % resultDict['down'][ 'node' + str(maxDict['down']['node']) ][ 'Ave' ][ 'D_G' ] ) |
chengchiyu | c6f4cc0 | 2016-08-24 14:04:20 -0700 | [diff] [blame] | 302 | |
| 303 | temp += "," + str( "%.2f" % resultDict['up'][ 'node' + str(maxDict['up']['node']) ][ 'Std' ][ 'E_E' ] ) |
| 304 | temp += "," + str( "%.2f" % resultDict['down'][ 'node' + str(maxDict['down']['node']) ][ 'Std' ][ 'E_E' ] ) |
| 305 | |
YPZhang | 38fb119 | 2016-08-11 11:03:38 -0700 | [diff] [blame] | 306 | temp += "\n" |
| 307 | dbFile.write( temp ) |
| 308 | dbFile.close() |