Merge branch 'devl/newOnosCHO' of https://github.com/opennetworkinglab/ONLabTest into devl/newOnosCHO
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index 0189e43..d59adbe 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -1483,6 +1483,145 @@
             main.cleanup()
             main.exit()
 
+    def addMplsIntent(
+            self,
+            ingressDevice,
+            egressDevice,
+            ingressPort="",
+            egressPort="",
+            ethType="",
+            ethSrc="",
+            ethDst="",
+            bandwidth="",
+            lambdaAlloc=False,
+            ipProto="",
+            ipSrc="",
+            ipDst="",
+            tcpSrc="",
+            tcpDst="",
+            ingressLabel="",
+            egressLabel="",
+            priority=""):
+        """
+        Required:
+            * ingressDevice: device id of ingress device
+            * egressDevice: device id of egress device
+        Optional:
+            * ethType: specify ethType
+            * ethSrc: specify ethSrc ( i.e. src mac addr )
+            * ethDst: specify ethDst ( i.e. dst mac addr )
+            * bandwidth: specify bandwidth capacity of link
+            * lambdaAlloc: if True, intent will allocate lambda
+              for the specified intent
+            * ipProto: specify ip protocol
+            * ipSrc: specify ip source address
+            * ipDst: specify ip destination address
+            * tcpSrc: specify tcp source port
+            * tcpDst: specify tcp destination port
+            * ingressLabel: Ingress MPLS label
+            * egressLabel: Egress MPLS label
+        Description:
+            Adds MPLS intent by
+            specifying device id's and optional fields
+        Returns:
+            A string of the intent id or None on error
+
+        NOTE: This function may change depending on the
+              options developers provide for MPLS
+              intent via cli
+        """
+        try:
+            # If there are no optional arguments
+            if not ethType and not ethSrc and not ethDst\
+                    and not bandwidth and not lambdaAlloc \
+                    and not ipProto and not ipSrc and not ipDst \
+                    and not tcpSrc and not tcpDst and not ingressLabel \
+                    and not egressLabel:
+                cmd = "add-mpls-intent"
+
+            else:
+                cmd = "add-mpls-intent"
+
+                if ethType:
+                    cmd += " --ethType " + str( ethType )
+                if ethSrc:
+                    cmd += " --ethSrc " + str( ethSrc )
+                if ethDst:
+                    cmd += " --ethDst " + str( ethDst )
+                if bandwidth:
+                    cmd += " --bandwidth " + str( bandwidth )
+                if lambdaAlloc:
+                    cmd += " --lambda "
+                if ipProto:
+                    cmd += " --ipProto " + str( ipProto )
+                if ipSrc:
+                    cmd += " --ipSrc " + str( ipSrc )
+                if ipDst:
+                    cmd += " --ipDst " + str( ipDst )
+                if tcpSrc:
+                    cmd += " --tcpSrc " + str( tcpSrc )
+                if tcpDst:
+                    cmd += " --tcpDst " + str( tcpDst )
+                if ingressLabel:
+                    cmd += " --ingressLabel " + str( ingressLabel )
+                if egressLabel:
+                    cmd += " --egressLabel " + str( egressLabel )
+                if priority:
+                    cmd += " --priority " + str( priority )
+
+            # Check whether the user appended the port
+            # or provided it as an input
+            if "/" in ingressDevice:
+                cmd += " " + str( ingressDevice )
+            else:
+                if not ingressPort:
+                    main.log.error( "You must specify the ingress port" )
+                    return None
+
+                cmd += " " + \
+                    str( ingressDevice ) + "/" +\
+                    str( ingressPort ) + " "
+
+            if "/" in egressDevice:
+                cmd += " " + str( egressDevice )
+            else:
+                if not egressPort:
+                    main.log.error( "You must specify the egress port" )
+                    return None
+
+                cmd += " " +\
+                    str( egressDevice ) + "/" +\
+                    str( egressPort )
+
+            handle = self.sendline( cmd )
+            # If error, return error message
+            if re.search( "Error", handle ):
+                main.log.error( "Error in adding mpls intent" )
+                return None
+            else:
+                # TODO: print out all the options in this message?
+                main.log.info( "MPLS intent installed between " +
+                               str( ingressDevice ) + " and " +
+                               str( egressDevice ) )
+                match = re.search('id=0x([\da-f]+),', handle)
+                if match:
+                    return match.group()[3:-1]
+                else:
+                    main.log.error( "Error, intent ID not found" )
+                    return None
+        except TypeError:
+            main.log.exception( self.name + ": Object not as expected" )
+            return None
+        except pexpect.EOF:
+            main.log.error( self.name + ": EOF exception found" )
+            main.log.error( self.name + ":    " + self.handle.before )
+            main.cleanup()
+            main.exit()
+        except Exception:
+            main.log.exception( self.name + ": Uncaught exception!" )
+            main.cleanup()
+            main.exit()
+
     def removeIntent( self, intentId, app='org.onosproject.cli',
                       purge=False, sync=False ):
         """
diff --git a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.py b/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.py
index 2ffcdb0..7bc654a 100644
--- a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.py
+++ b/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.py
@@ -157,7 +157,7 @@
 
     def CASE2(self, main):
         """
-        Assign s1 to ONOS1 and measure latency
+        Assign s3 to ONOS1 and measure latency
         
         There are 4 levels of latency measurements to this test:
         1 ) End-to-end measurement: Complete end-to-end measurement
@@ -379,9 +379,16 @@
                 # measurement. 
                 tcpToFeature = int(featureTimestamp) - int(t0Tcp)
                 featureToRole = int(roleTimestamp) - int(featureTimestamp)
-                roleToOfp = int(t0Ofp) - int(roleTimestamp)
-                ofpToDevice = int(deviceTimestamp) - int(t0Ofp)
-                deviceToGraph = float(graphTimestamp) - float(deviceTimestamp)
+                roleToOfp = float(t0Ofp) - float(roleTimestamp)
+                ofpToDevice = float(deviceTimestamp) - float(t0Ofp)
+                # Timestamps gathered from ONOS are millisecond 
+                # precision. They are returned as integers, thus no
+                # need to be more precise than 'int'. However,
+                # the processing seems to be mostly under 1 ms, 
+                # thus this may be a problem point to handle any 
+                # submillisecond output that we are unsure of.
+                # For now, this will be treated as 0 ms if less than 1 ms
+                deviceToGraph = int(graphTimestamp) - int(deviceTimestamp)
                 
                 if endToEnd > thresholdMin and\
                    endToEnd < thresholdMax and i >= iterIgnore:
@@ -429,7 +436,7 @@
                     main.log.info("ONOS "+str(nodeNum)+ " reply-to-device: "+
                             str(ofpToDevice) + " ms")
                 else:
-                    main.log.info("ONOS "+str(nodeNum)+ " role-to-reply "+
+                    main.log.info("ONOS "+str(nodeNum)+ " reply-to-device "+
                             "measurement ignored due to excess in "+
                             "threshold or premature iteration")
 
@@ -439,7 +446,15 @@
                     main.log.info("ONOS "+str(nodeNum)+ " device-to-graph: "+
                             str(deviceToGraph) + " ms")
                 else:
-                    main.log.info("ONOS "+str(nodeNum)+ " device-to-graph "+
+                    if deviceToGraph == 0:
+                        deviceToGraphLatNodeIter[node][i] = 0
+                        main.log.info("ONOS "+str(nodeNum) +
+                            " device-to-graph measurement "+
+                            "was set to 0 ms because of precision "+
+                            "uncertainty")
+                    else:
+                        main.log.info("ONOS "+str(nodeNum)+ 
+                            " device-to-graph "+
                             "measurement ignored due to excess in "+
                             "threshold or premature iteration")
                                 
@@ -500,7 +515,7 @@
             with open(tsharkFinAckOutput, 'r') as f:
                 tempLine = f.readlines()
                 main.log.info('Object read in from FinAck capture: ' +
-                    str(tempLine))
+                    "\n".join(tempLine))
                 
                 index = 1
                 for line in tempLine:
@@ -541,7 +556,7 @@
                     graphTimestamp = 0
                     deviceTimestamp = 0
                
-                finAckTransaction = int(tAck) - int(tFinAck)
+                finAckTransaction = float(tAck) - float(tFinAck)
                 ackToDevice = int(deviceTimestamp) - int(tAck)
                 deviceToGraph = int(graphTimestamp) - int(deviceTimestamp)
                 endToEndDisc = int(graphTimestamp) - int(tFinAck)
@@ -742,12 +757,23 @@
             main.log.report(' Device-to-graph (disconnect) Std dev: ' +
                     str(deviceToGraphDiscStdDev) + ' ms')
 
+            # For database schema, refer to Amazon web services
             dbCmdList.append(
-                    "INSERT INTO switch_latency_tests VALUES('" +
+                    "INSERT INTO switch_latency_details VALUES('" +
                     timeToPost + "','switch_latency_results'," +
                     jenkinsBuildNumber + ',' + str(clusterCount) + ",'baremetal" + 
-                    str(node + 1) + "'," + str(endToEndAvg) + ',' +
-                    str(endToEndStdDev) + ',0,0);')
+                    str(node + 1) + "'," + 
+                    str(endToEndAvg) + ',' +
+                    str(tcpToFeatureAvg) + ',' +
+                    str(featureToRoleAvg) + ',' +
+                    str(roleToOfpAvg) + ',' +
+                    str(ofpToDeviceAvg) + ',' +
+                    str(deviceToGraphAvg) + ',' +
+                    str(endToEndDiscAvg) + ',' +
+                    str(finAckAvg) + ',' +
+                    str(ackToDeviceAvg) + ',' +
+                    str(deviceToGraphDiscAvg) + 
+                    ');')
 
         if debugMode == 'on':
             main.ONOS1.cpLogsToDir('/opt/onos/log/karaf.log',
@@ -756,9 +782,10 @@
         for line in dbCmdList:
             if line:
                 fResult.write(line + '\n')
-
         fResult.close()
+        
         assertion = main.TRUE
+        
         utilities.assert_equals(expect=main.TRUE, actual=assertion,
                 onpass='Switch latency test successful', 
                 onfail='Switch latency test failed')
@@ -829,19 +856,16 @@
                 ip1=ONOS1Ip, port1=defaultSwPort)
         
         time.sleep(15)
-        
-        portUpDeviceToOfpList = []
-        portUpGraphToOfpList = []
-        portDownDeviceToOfpList = []
-        portDownGraphToOfpList = []
-        
-        portUpDevNodeIter = numpy.zeros((clusterCount, int(numIter)))
-        portUpGraphNodeIter = numpy.zeros((clusterCount, int(numIter)))
-        portUpLinkLatNodeIter = numpy.zeros((clusterCount, int(numIter)))
-        portDownDevNodeIter = numpy.zeros((clusterCount, int(numIter)))
-        portDownGraphNodeIter = numpy.zeros((clusterCount, int(numIter)))
-        portDownLinkNodeIter = numpy.zeros((clusterCount, int(numIter)))
-        portUpLinkNodeIter = numpy.zeros((clusterCount, int(numIter)))
+     
+        portUpEndToEndNodeIter = numpy.zeros((clusterCount, int(numIter)))
+        portUpOfpToDevNodeIter = numpy.zeros((clusterCount, int(numIter)))
+        portUpDevToLinkNodeIter = numpy.zeros((clusterCount, int(numIter)))
+        portUpLinkToGraphNodeIter = numpy.zeros((clusterCount, int(numIter)))
+
+        portDownEndToEndNodeIter = numpy.zeros((clusterCount, int(numIter)))
+        portDownOfpToDevNodeIter = numpy.zeros((clusterCount, int(numIter)))
+        portDownDevToLinkNodeIter = numpy.zeros((clusterCount, int(numIter)))
+        portDownLinkToGraphNodeIter = numpy.zeros((clusterCount, int(numIter)))
         
         for i in range(0, int(numIter)):
             main.step('Starting wireshark capture for port status down')
@@ -898,41 +922,53 @@
                     deviceTimestamp = 0
                     linkTimestamp = 0
 
-                ptDownGraphToOfp = int(graphTimestamp) - int(timestampBeginPtDown)
-                ptDownDeviceToOfp = int(deviceTimestamp) - int(timestampBeginPtDown)
-                ptDownLinkToOfp = int(linkTimestamp) - int(timestampBeginPtDown)
+                ptDownEndToEnd = int(graphTimestamp) - int(timestampBeginPtDown)
+                ptDownOfpToDevice = int(deviceTimestamp) - int(timestampBeginPtDown)
+                ptDownDeviceToLink = int(linkTimestamp) - int(deviceTimestamp)
+                ptDownLinkToGraph = int(graphTimestamp) - int(linkTimestamp)
 
-                if ptDownGraphToOfp > downThresholdMin and\
-                   ptDownGraphToOfp < downThresholdMax and i >= iterIgnore:
-                    portDownGraphNodeIter[node][i] = ptDownGraphToOfp
+                if ptDownEndToEnd > downThresholdMin and\
+                   ptDownEndToEnd < downThresholdMax and i >= iterIgnore:
+                    portDownEndToEndNodeIter[node][i] = ptDownEndToEnd
                     main.log.info("ONOS "+str(nodeNum)+ 
-                            " port down graph-to-ofp: "+
-                            str(ptDownGraphToOfp) + " ms") 
+                            " port down End-to-end: "+
+                            str(ptDownEndToEnd) + " ms") 
                 else:
                     main.log.info("ONOS "+str(nodeNum)+
-                            " port down graph-to-ofp ignored"+
+                            " port down End-to-end ignored"+
                             " due to excess in threshold or premature iteration")
 
-                if ptDownDeviceToOfp > downThresholdMin and\
-                   ptDownDeviceToOfp < downThresholdMax and i >= iterIgnore:
-                    portDownDevNodeIter[node][i] = ptDownDeviceToOfp
+                if ptDownOfpToDevice > downThresholdMin and\
+                   ptDownOfpToDevice < downThresholdMax and i >= iterIgnore:
+                    portDownOfpToDevNodeIter[node][i] = ptDownOfpToDevice
                     main.log.info("ONOS "+str(nodeNum)+ 
-                            " port down device-to-ofp: "+
-                            str(ptDownDeviceToOfp) + " ms") 
+                            " port down Ofp-to-device: "+
+                            str(ptDownOfpToDevice) + " ms") 
                 else:
                     main.log.info("ONOS "+str(nodeNum)+
-                            " port down device-to-ofp ignored"+
+                            " port down Ofp-to-device ignored"+
                             " due to excess in threshold or premature iteration")
 
-                if ptDownLinkToOfp > downThresholdMin and\
-                   ptDownLinkToOfp < downThresholdMax and i >= iterIgnore:
-                    portDownLinkNodeIter[node][i] = ptDownLinkToOfp
+                if ptDownDeviceToLink > downThresholdMin and\
+                   ptDownDeviceToLink < downThresholdMax and i >= iterIgnore:
+                    portDownDevToLinkNodeIter[node][i] = ptDownDeviceToLink
                     main.log.info("ONOS "+str(nodeNum)+
-                            " port down link-to-ofp: "+
-                            str(ptDownLinkToOfp) + " ms")
+                            " port down Device-to-link "+
+                            str(ptDownDeviceToLink) + " ms")
                 else:
                     main.log.info("ONOS "+str(nodeNum)+
-                            " port down link-to-ofp ignored"+
+                            " port down Device-to-link ignored"+
+                            " due to excess in threshold or premature iteration")
+
+                if ptDownLinkToGraph > downThresholdMin and\
+                   ptDownLinkToGraph < downThresholdMax and i >= iterIgnore:
+                    portDownLinkToGraphNodeIter[node][i] = ptDownLinkToGraph
+                    main.log.info("ONOS "+str(nodeNum)+
+                            " port down Link-to-graph "+
+                            str(ptDownLinkToGraph) + " ms")
+                else:
+                    main.log.info("ONOS "+str(nodeNum)+
+                            " port down Link-to-graph ignored"+
                             " due to excess in threshold or premature iteration")
 
             time.sleep(3)
@@ -981,114 +1017,158 @@
                     deviceTimestamp = 0
                     linkTimestamp = 0
 
-                ptUpGraphToOfp = int(graphTimestamp) - int(timestampBeginPtUp)
-                ptUpDeviceToOfp = int(deviceTimestamp) - int(timestampBeginPtUp)
-                ptUpLinkToOfp = int(linkTimestamp) - int(timestampBeginPtUp)
+                ptUpEndToEnd = int(graphTimestamp) - int(timestampBeginPtUp)
+                ptUpOfpToDevice = int(deviceTimestamp) - int(timestampBeginPtUp)
+                ptUpDeviceToLink = int(linkTimestamp) - int(deviceTimestamp)
+                ptUpLinkToGraph = int(graphTimestamp) - int(linkTimestamp)
 
-                if ptUpGraphToOfp > upThresholdMin and\
-                   ptUpGraphToOfp < upThresholdMax and i > iterIgnore:
-                    portUpGraphNodeIter[node][i] = ptUpGraphToOfp
+                if ptUpEndToEnd > upThresholdMin and\
+                   ptUpEndToEnd < upThresholdMax and i > iterIgnore:
+                    portUpEndToEndNodeIter[node][i] = ptUpEndToEnd
                     main.log.info("ONOS "+str(nodeNum)+ 
-                            " port up graph-to-ofp: "+
-                            str(ptUpGraphToOfp) + " ms") 
+                            " port up End-to-end: "+
+                            str(ptUpEndToEnd) + " ms") 
                 else:
                     main.log.info("ONOS "+str(nodeNum)+
-                            " port up graph-to-ofp ignored"+
+                            " port up End-to-end ignored"+
                             " due to excess in threshold or premature iteration")
 
-                if ptUpDeviceToOfp > upThresholdMin and\
-                   ptUpDeviceToOfp < upThresholdMax and i > iterIgnore:
-                    portUpDevNodeIter[node][i] = ptUpDeviceToOfp
+                if ptUpOfpToDevice > upThresholdMin and\
+                   ptUpOfpToDevice < upThresholdMax and i > iterIgnore:
+                    portUpOfpToDevNodeIter[node][i] = ptUpOfpToDevice
                     main.log.info("ONOS "+str(nodeNum)+ 
-                            " port up device-to-ofp: "+
-                            str(ptUpDeviceToOfp) + " ms") 
+                            " port up Ofp-to-device: "+
+                            str(ptUpOfpToDevice) + " ms") 
                 else:
                     main.log.info("ONOS "+str(nodeNum)+
-                            " port up device-to-ofp ignored"+
+                            " port up Ofp-to-device ignored"+
                             " due to excess in threshold or premature iteration")
 
-                if ptUpLinkToOfp > upThresholdMin and\
-                   ptUpLinkToOfp < upThresholdMax and i > iterIgnore:
-                    portUpLinkNodeIter[node][i] = ptUpLinkToOfp
+                if ptUpDeviceToLink > upThresholdMin and\
+                   ptUpDeviceToLink < upThresholdMax and i > iterIgnore:
+                    portUpDevToLinkNodeIter[node][i] = ptUpDeviceToLink
                     main.log.info("ONOS "+str(nodeNum)+
-                            " port up link-to-ofp: "+
-                            str(ptUpLinkToOfp) + " ms")
+                            " port up Device-to-link: "+
+                            str(ptUpDeviceToLink) + " ms")
                 else:
                     main.log.info("ONOS "+str(nodeNum)+
-                            " port up link-to-ofp ignored"+
+                            " port up Device-to-link ignored"+
+                            " due to excess in threshold or premature iteration")
+                
+                if ptUpLinkToGraph > upThresholdMin and\
+                   ptUpLinkToGraph < upThresholdMax and i > iterIgnore:
+                    portUpLinkToGraphNodeIter[node][i] = ptUpLinkToGraph
+                    main.log.info("ONOS "+str(nodeNum)+
+                            " port up Link-to-graph: "+
+                            str(ptUpLinkToGraph) + " ms")
+                else:
+                    main.log.info("ONOS "+str(nodeNum)+
+                            " port up Link-to-graph ignored"+
                             " due to excess in threshold or premature iteration")
 
         dbCmdList = []
         for node in range(0, clusterCount):
-            portUpDevList = []
-            portUpGraphList = []
-            portUpLinkList = []
-            portDownDevList = []
-            portDownGraphList = []
-            portDownLinkList = []
+            portUpEndToEndList = []
+            portUpOfpToDevList = []
+            portUpDevToLinkList = []
+            portUpLinkToGraphList = []
 
-            portUpDevAvg = 0
-            portUpGraphAvg = 0
-            portUpLinkAvg = 0
-            portDownDevAvg = 0
-            portDownGraphAvg = 0
-            portDownLinkAvg = 0
+            portDownEndToEndList = []
+            portDownOfpToDevList = []
+            portDownDevToLinkList = []
+            portDownLinkToGraphList = []
 
-            for item in portUpDevNodeIter[node]:
-                if item > 0.0:
-                    portUpDevList.append(item)
-
-            for item in portUpGraphNodeIter[node]:
-                if item > 0.0:
-                    portUpGraphList.append(item)
-
-            for item in portUpLinkNodeIter[node]:
-                if item > 0.0:
-                    portUpLinkList.append(item)
-
-            for item in portDownDevNodeIter[node]:
-                if item > 0.0:
-                    portDownDevList.append(item)
-
-            for item in portDownGraphNodeIter[node]:
-                if item > 0.0:
-                    portDownGraphList.append(item)
-
-            for item in portDownLinkNodeIter[node]:
-                if item > 0.0:
-                    portDownLinkList.append(item)
-
-            portUpDevAvg = round(numpy.mean(portUpDevList), 2)
-            portUpGraphAvg = round(numpy.mean(portUpGraphList), 2)
-            portUpLinkAvg = round(numpy.mean(portUpLinkList), 2)
-
-            portDownDevAvg = round(numpy.mean(portDownDevList), 2)
-            portDownGraphAvg = round(numpy.mean(portDownGraphList), 2)
-            portDownLinkAvg = round(numpy.mean(portDownLinkList), 2)
+            portUpEndToEndAvg = 0
+            portUpOfpToDevAvg = 0
+            portUpDevToLinkAvg = 0
+            portUpLinkToGraphAvg = 0
             
-            portUpStdDev = round(numpy.std(portUpGraphList), 2)
-            portDownStdDev = round(numpy.std(portDownGraphList), 2)
+            portDownEndToEndAvg = 0
+            portDownOfpToDevAvg = 0
+            portDownDevToLinkAvg = 0
+            portDownLinkToGraphAvg = 0
+
+            # TODO: Update for more pythonic way to get list
+            # portUpDevList = [item for item in portUpDevNodeIter[node] 
+            #        if item > 0.0] 
+            for item in portUpEndToEndNodeIter[node]:
+                if item > 0.0:
+                    portUpEndToEndList.append(item)
+
+            for item in portUpOfpToDevNodeIter[node]:
+                if item > 0.0:
+                    portUpOfpToDevList.append(item)
+                
+            for item in portUpDevToLinkNodeIter[node]:
+                if item > 0.0:
+                    portUpDevToLinkList.append(item)
+
+            for item in portUpLinkToGraphNodeIter[node]:
+                if item > 0.0:
+                    portUpLinkToGraphList.append(item)
+
+
+            for item in portDownEndToEndNodeIter[node]:
+                if item > 0.0:
+                    portDownEndToEndList.append(item)
+
+            for item in portDownOfpToDevNodeIter[node]:
+                if item > 0.0:
+                    portDownOfpToDevList.append(item)
+
+            for item in portDownDevToLinkNodeIter[node]:
+                if item > 0.0:
+                    portDownDevToLinkList.append(item)
+
+            for item in portDownLinkToGraphNodeIter[node]:
+                if item > 0.0:
+                    portDownLinkToGraphList.append(item)
+
+            portUpEndToEndAvg = round(numpy.mean(portUpEndToEndList), 2)
+            portUpOfpToDevAvg = round(numpy.mean(portUpOfpToDevList), 2)
+            portUpDevToLinkAvg = round(numpy.mean(portUpDevToLinkList), 2)
+            portUpLinkToGraphAvg = round(numpy.mean(portUpLinkToGraphList), 2)
+
+            portDownEndToEndAvg = round(numpy.mean(portDownEndToEndList), 2)
+            portDownOfpToDevAvg = round(numpy.mean(portDownOfpToDevList), 2)
+            portDownDevToLinkAvg = round(numpy.mean(portDownDevToLinkList), 2)
+            portDownLinkToGraphAvg = round(numpy.mean(portDownLinkToGraphList), 2)
+            
+            portUpStdDev = round(numpy.std(portUpEndToEndList), 2)
+            portDownStdDev = round(numpy.std(portDownEndToEndList), 2)
            
             main.log.report(' - Node ' + str(node + 1) + ' Summary - ')
-            main.log.report(' Port up ofp-to-device ' +
-                    str(portUpDevAvg) + ' ms')
-            main.log.report(' Port up ofp-to-graph ' +
-                    str(portUpGraphAvg) + ' ms')
-            main.log.report(' Port up ofp-to-link ' +
-                    str(portUpLinkAvg) + ' ms')
+            main.log.report(' Port up End-to-end ' +
+                    str(portUpEndToEndAvg) + ' ms')
+            main.log.report(' Port up Ofp-to-device ' +
+                    str(portUpOfpToDevAvg) + ' ms')
+            main.log.report(' Port up Device-to-link ' +
+                    str(portUpDevToLinkAvg) + ' ms')
+            main.log.report(' Port up Link-to-graph ' +
+                    str(portUpLinkToGraphAvg) + ' ms')
             
-            main.log.report(' Port down ofp-to-device ' +
-                    str(round(portDownDevAvg, 2)) + ' ms')
-            main.log.report(' Port down ofp-to-graph ' +
-                    str(portDownGraphAvg) + ' ms')
-            main.log.report(' Port down ofp-to-link ' +
-                    str(portDownLinkAvg) + ' ms')
+            main.log.report(' Port down End-to-end ' +
+                    str(round(portDownEndToEndAvg, 2)) + ' ms')
+            main.log.report(' Port down Ofp-to-device ' +
+                    str(portDownOfpToDevAvg) + ' ms')
+            main.log.report(' Port down Device-to-link' +
+                    str(portDownDevToLinkAvg) + ' ms')
+            main.log.report(' Port down Link-to-graph' +
+                    str(portDownLinkToGraphAvg) + ' ms')
 
-            dbCmdList.append("INSERT INTO port_latency_tests VALUES('" + 
+            dbCmdList.append("INSERT INTO port_latency_details VALUES('" + 
                     timeToPost + "','port_latency_results'," + jenkinsBuildNumber +
                     ',' + str(clusterCount) + ",'baremetal" + str(node + 1) +
-                    "'," + str(portUpGraphAvg) + ',' + str(portUpStdDev) +
-                    '' + str(portDownGraphAvg) + ',' + str(portDownStdDev) + ');')
+                    "'," +
+                    str(portUpEndToEndAvg) +',' +
+                    str(portUpOfpToDevAvg) + ',' +
+                    str(portUpDevToLinkAvg) + ',' +
+                    str(portUpLinkToGraphAvg) + ',' + 
+                    str(portDownEndToEndAvg) + ',' +
+                    str(portDownOfpToDevAvg) + ',' +
+                    str(portDownDevToLinkAvg) + ',' +
+                    str(portDownLinkToGraphAvg) +
+                    ');')
 
         fResult = open(resultPath, 'a')
         for line in dbCmdList: