[ONOS-7113] Adding values to the bars on the bar graphs on the wiki

- Each bar graph peak now states the numerical value for easier reading
- Text and comment fixes among all graphs

Change-Id: Idf66d9bbaac1495a6dea09052c1db95176d4ca43
diff --git a/TestON/JenkinsFile/scripts/SCPFIntentInstallWithdrawRerouteLat.R b/TestON/JenkinsFile/scripts/SCPFIntentInstallWithdrawRerouteLat.R
index 186c1c2..98447ca 100644
--- a/TestON/JenkinsFile/scripts/SCPFIntentInstallWithdrawRerouteLat.R
+++ b/TestON/JenkinsFile/scripts/SCPFIntentInstallWithdrawRerouteLat.R
@@ -127,6 +127,8 @@
 
 dataFrame <- na.omit( dataFrame )   # Omit any data that doesn't exist
 
+
+
 print( "Data Frame Results:" )
 print( dataFrame )
 
@@ -166,10 +168,11 @@
 
 theme <- theme( plot.title=element_text( hjust = 0.5, size = 22, face='bold' ) )
 
+
+
 # Store plot configurations as 1 variable
 fundamentalGraphData <- mainPlot + xScaleConfig + xLabel + yLabel + fillLabel + theme
 
-
 # Create the bar graph with error bars.
 # geom_bar contains:
 #    - stat: data formatting (usually "identity")
@@ -177,9 +180,11 @@
 # geom_errorbar contains similar arguments as geom_bar.
 print( "Generating bar graph with error bars." )
 barGraphFormat <- geom_bar( stat = "identity", width = width, position = "dodge" )
-errorBarFormat <- geom_errorbar( width = width, position = "dodge" )
+errorBarFormat <- geom_errorbar( width = width, position = "dodge", color=rgb( 140, 140, 140, maxColorValue=255 ) )
 title <- ggtitle( chartTitle )
-result <- fundamentalGraphData + barGraphFormat + errorBarFormat + title
+values <- geom_text( aes( x=dataFrame$scale, y=dataFrame$ms + 0.035 * max( dataFrame$ms ), label = format( dataFrame$ms, digits=3, big.mark = ",", scientific = FALSE ) ), position=position_dodge( width=1.3 ), size = 3.2, fontface = "bold" )
+
+result <- fundamentalGraphData + barGraphFormat + errorBarFormat + title + values
 
 # Save graph to file
 print( paste( "Saving bar chart with error bars to", errBarOutputFile ) )
diff --git a/TestON/JenkinsFile/scripts/SCPFbatchFlowResp.R b/TestON/JenkinsFile/scripts/SCPFbatchFlowResp.R
index 3698afb..72f66c7 100644
--- a/TestON/JenkinsFile/scripts/SCPFbatchFlowResp.R
+++ b/TestON/JenkinsFile/scripts/SCPFbatchFlowResp.R
@@ -105,11 +105,13 @@
 fundamentalGraphData <- mainPlot + xScaleConfig + xLabel + yLabel + fillLabel + theme
 
 
-print( "Generating bar graph with error bars." )
+print( "Generating bar graph." )
 width <- 0.3
 barGraphFormat <- geom_bar( stat="identity", width = width )
+sum <- fileData[ 'posttoconfrm' ] + fileData[ 'elapsepost' ]
+values <- geom_text( aes( x=dataFrame$iterative, y=sum + 0.04 * max( sum ), label = format( sum, digits=3, big.mark = ",", scientific = FALSE ) ), size = 5, fontface = "bold" )
 title <- ggtitle( chartTitle )
-result <- fundamentalGraphData + barGraphFormat + title
+result <- fundamentalGraphData + barGraphFormat + title + values
 
 
 print( paste( "Saving bar chart to", errBarOutputFile ) )
@@ -161,12 +163,14 @@
 fundamentalGraphData <- mainPlot + xScaleConfig + xLabel + yLabel + fillLabel + theme
 
 
-print( "Generating bar graph with error bars." )
+print( "Generating bar graph." )
 width <- 0.3
 barGraphFormat <- geom_bar( stat="identity", width = width )
+sum <- fileData[ 'deltoconfrm' ] + fileData[ 'elapsedel' ]
+values <- geom_text( aes( x=dataFrame$iterative, y=sum + 0.04 * max( sum ), label = format( sum, digits=3, big.mark = ",", scientific = FALSE ) ), size = 5, fontface = "bold" )
 chartTitle <- paste( "Single Bench Flow Latency - Del", "Last 3 Builds", sep = "\n" )
 title <- ggtitle( chartTitle )
-result <- fundamentalGraphData + barGraphFormat + title
+result <- fundamentalGraphData + barGraphFormat + title + values
 
 errBarOutputFile <- paste( args[ 7 ], args[ 5 ], sep="" )
 errBarOutputFile <- paste( errBarOutputFile, args[ 6 ], sep="_" )
diff --git a/TestON/JenkinsFile/scripts/SCPFcbench.R b/TestON/JenkinsFile/scripts/SCPFcbench.R
index bccfb38..c9a6c37 100644
--- a/TestON/JenkinsFile/scripts/SCPFcbench.R
+++ b/TestON/JenkinsFile/scripts/SCPFcbench.R
@@ -96,8 +96,8 @@
 theme_set( theme_grey( base_size = 20 ) )   # set the default text size of the graph.
 
 mainPlot <- ggplot( data = dataFrame, aes( x = iterative, y = ms, ymin = ms - std, ymax = ms + std ) )
-xScaleConfig <- scale_x_continuous( breaks = dataFrame$iterative, label = dataFrame$date )
-xLabel <- xlab( "date" )
+xScaleConfig <- scale_x_continuous( breaks = dataFrame$iterative,   label = dataFrame$date )
+xLabel <- xlab( "Build Date" )
 yLabel <- ylab( "Responses / sec" )
 fillLabel <- labs( fill="Type" )
 theme <- theme( plot.title=element_text( hjust = 0.5, size = 28, face='bold' ) )
@@ -108,9 +108,10 @@
 print( "Generating bar graph with error bars." )
 width <- 0.3
 barGraphFormat <- geom_bar( stat="identity", position = position_dodge(), width = width, fill="#00AA13" )
-errorBarFormat <- geom_errorbar( position=position_dodge( ), width = width )
+errorBarFormat <- geom_errorbar( width = width, color=rgb( 140, 140,140, maxColorValue=255 ) )
+values <- geom_text( aes( x=dataFrame$iterative, y=fileData[ 'avg' ] + 0.025 * max( fileData[ 'avg' ] ), label = format( fileData[ 'avg' ], digits=3, big.mark = ",", scientific = FALSE ) ), size = 4.5, fontface = "bold" )
 title <- ggtitle( chartTitle )
-result <- fundamentalGraphData + barGraphFormat + errorBarFormat + title
+result <- fundamentalGraphData + barGraphFormat + errorBarFormat + title + values
 
 
 print( paste( "Saving bar chart with error bars to", errBarOutputFile ) )
diff --git a/TestON/JenkinsFile/scripts/SCPFflowTp1g.R b/TestON/JenkinsFile/scripts/SCPFflowTp1g.R
index 89e2379..8ec053e 100644
--- a/TestON/JenkinsFile/scripts/SCPFflowTp1g.R
+++ b/TestON/JenkinsFile/scripts/SCPFflowTp1g.R
@@ -158,6 +158,7 @@
 
 theme <- theme( plot.title=element_text( hjust = 0.5, size = 28, face='bold' ) )
 
+
 # Store plot configurations as 1 variable
 fundamentalGraphData <- mainPlot + xScaleConfig + xLabel + yLabel + fillLabel + theme
 
@@ -169,9 +170,10 @@
 # geom_errorbar contains similar arguments as geom_bar.
 print( "Generating bar graph with error bars." )
 barGraphFormat <- geom_bar( stat = "identity", width = width, fill="#FFA94F" )
-errorBarFormat <- geom_errorbar( position=position_dodge( ), width = width )
+errorBarFormat <- geom_errorbar( width = width, position=position_dodge(), color=rgb( 140,140,140, maxColorValue=255 ) )
+values <- geom_text( aes( x=dataFrame$scale, y=dataFrame$throughput + 0.04 * max( dataFrame$throughput ), label = format( dataFrame$throughput, digits=3, big.mark = ",", scientific = FALSE ) ), size = 5, fontface = "bold" )
 title <- ggtitle( paste( chartTitle, "" ) )
-result <- fundamentalGraphData + barGraphFormat + errorBarFormat + title
+result <- fundamentalGraphData + barGraphFormat + errorBarFormat + title + values
 
 # Save graph to file
 print( paste( "Saving bar chart with error bars to", errBarOutputFile ) )
diff --git a/TestON/JenkinsFile/scripts/SCPFhostLat.R b/TestON/JenkinsFile/scripts/SCPFhostLat.R
index e17cedb..738765a 100644
--- a/TestON/JenkinsFile/scripts/SCPFhostLat.R
+++ b/TestON/JenkinsFile/scripts/SCPFhostLat.R
@@ -108,9 +108,10 @@
 print( "Generating bar graph with error bars." )
 width <- 0.9
 barGraphFormat <- geom_bar( stat="identity", position=position_dodge( ), width = width, fill="#E8BD00" )
-errorBarFormat <- geom_errorbar( position=position_dodge( ), width = width )
+errorBarFormat <- geom_errorbar( position=position_dodge(), width = width, color=rgb( 140, 140, 140, maxColorValue=255 ) )
+values <- geom_text( aes( x=dataFrame$scale, y=dataFrame$ms + 0.08 * max( dataFrame$ms ), label = format( dataFrame$ms, digits=3, big.mark = ",", scientific = FALSE ) ), size = 5, fontface = "bold" )
 title <- ggtitle( paste( chartTitle, "with Standard Error Bars" ) )
-result <- fundamentalGraphData + barGraphFormat + errorBarFormat + title
+result <- fundamentalGraphData + barGraphFormat + errorBarFormat + title + values
 
 
 print( paste( "Saving bar chart with error bars to", errBarOutputFile ) )
diff --git a/TestON/JenkinsFile/scripts/SCPFintentEventTp.R b/TestON/JenkinsFile/scripts/SCPFintentEventTp.R
index 7a55371..420b444 100644
--- a/TestON/JenkinsFile/scripts/SCPFintentEventTp.R
+++ b/TestON/JenkinsFile/scripts/SCPFintentEventTp.R
@@ -120,7 +120,6 @@
 #    These are variables that apply to all of the graphs being generated, regardless of type.
 #
 # 2. Type specific graph data is generated.
-#     Data specific for the error bar and stacked bar graphs are generated.
 #
 # 3. Generate and save the graphs.
 #      Graphs are saved to the filename above, in the directory provided in command line args
@@ -156,16 +155,12 @@
 }
 
 theme <- theme( plot.title=element_text( hjust = 0.5, size = 28, face='bold' ) )
+values <- geom_text( aes( x=dataFrame$scale, y=dataFrame$throughput + 0.04 * max( dataFrame$throughput ), label = format( dataFrame$throughput, digits=3, big.mark = ",", scientific = FALSE ) ), size = 5, fontface = "bold" )
 
 # Store plot configurations as 1 variable
-fundamentalGraphData <- mainPlot + xScaleConfig + xLabel + yLabel + fillLabel + theme
+fundamentalGraphData <- mainPlot + xScaleConfig + xLabel + yLabel + fillLabel + theme + values
 
 
-# Create the stacked bar graph with error bars.
-# geom_bar contains:
-#    - stat: data formatting (usually "identity")
-#    - width: the width of the bar types (declared above)
-# geom_errorbar contains similar arguments as geom_bar.
 print( "Generating bar graph." )
 barGraphFormat <- geom_bar( stat = "identity", width = width, fill="#169EFF" )
 title <- ggtitle( paste( chartTitle, "" ) )
diff --git a/TestON/JenkinsFile/scripts/SCPFmastershipFailoverLat.R b/TestON/JenkinsFile/scripts/SCPFmastershipFailoverLat.R
index 09ac5cb..9eea330 100644
--- a/TestON/JenkinsFile/scripts/SCPFmastershipFailoverLat.R
+++ b/TestON/JenkinsFile/scripts/SCPFmastershipFailoverLat.R
@@ -125,10 +125,11 @@
 
 print( "Generating bar graph with error bars." )
 width <- 0.9
-barGraphFormat <- geom_bar( stat="identity", position=position_dodge( ), width = width )
-errorBarFormat <- geom_errorbar( position=position_dodge( ), width = width )
-title <- ggtitle( paste( chartTitle, "with Standard Error Bars" ) )
-result <- fundamentalGraphData + barGraphFormat + errorBarFormat + title
+barGraphFormat <- geom_bar( stat="identity", position=position_dodge(), width = width )
+errorBarFormat <- geom_errorbar( width = width, position=position_dodge(), color=rgb( 140, 140, 140, maxColorValue=255 ) )
+values <- geom_text( aes( x=avgData$scale, y=avgData$ms + 0.04 * max( avgData$ms ), label = format( avgData$ms, digits=3, big.mark = ",", scientific = FALSE ) ), size = 5, fontface = "bold", position=position_dodge( 0.9 ) )
+title <- ggtitle( paste( chartTitle, "" ) )
+result <- fundamentalGraphData + barGraphFormat + errorBarFormat + title + values
 
 
 print( paste( "Saving bar chart with error bars to", errBarOutputFile ) )
@@ -140,8 +141,10 @@
 
 print( "Generating stacked bar chart." )
 stackedBarFormat <- geom_bar( stat="identity", width=width )
-title <- ggtitle( paste( chartTitle, "Total Latency" ) )
-result <- fundamentalGraphData + stackedBarFormat + title
+title <- ggtitle( paste( chartTitle, "" ) )
+sum <- fileData[ 'deact_role_avg' ] + fileData[ 'kill_deact_avg' ]
+values <- geom_text( aes( x=avgData$scale, y=sum + 0.04 * max( sum ), label = format( sum, digits=3, big.mark = ",", scientific = FALSE ) ), size = 5, fontface = "bold" )
+result <- fundamentalGraphData + stackedBarFormat + title + values
 
 
 print( paste( "Saving stacked bar chart to", stackedBarOutputFile ) )
diff --git a/TestON/JenkinsFile/scripts/SCPFportLat.R b/TestON/JenkinsFile/scripts/SCPFportLat.R
index e4b9d4f..fd24c8d 100644
--- a/TestON/JenkinsFile/scripts/SCPFportLat.R
+++ b/TestON/JenkinsFile/scripts/SCPFportLat.R
@@ -124,10 +124,11 @@
 
 print( "Generating bar graph with error bars (Port Up Latency)." )
 barGraphFormat <- geom_bar( stat="identity", width = width )
-errorBarFormat <- geom_errorbar( width = width )
-
+errorBarFormat <- geom_errorbar( width = width, color=rgb( 140, 140, 140, maxColorValue=255 ) )
+sum <- fileData[ 'up_ofp_to_dev_avg' ] + fileData[ 'up_dev_to_link_avg' ] + fileData[ 'up_link_to_graph_avg' ]
+values <- geom_text( aes( x=upAvgsData$scale, y=sum + 0.04 * max( sum ), label = format( sum, digits=3, big.mark = ",", scientific = FALSE ) ), size = 5, fontface = "bold" )
 title <- ggtitle( "Port Up Latency" )
-result <- fundamentalGraphData + barGraphFormat + errorBarFormat + title
+result <- fundamentalGraphData + barGraphFormat + errorBarFormat + title + values
 
 
 print( paste( "Saving bar chart with error bars (Port Up Latency) to", errBarOutputFileUp ) )
@@ -146,10 +147,12 @@
 
 print( "Generating bar graph with error bars (Port Down Latency)." )
 barGraphFormat <- geom_bar( stat="identity", width = width )
-errorBarFormat <- geom_errorbar( width = width )
+errorBarFormat <- geom_errorbar( width = width, color=rgb( 140, 140, 140, maxColorValue=255 ) )
+sum <- fileData[ 'down_ofp_to_dev_avg' ] + fileData[ 'down_dev_to_link_avg' ] + fileData[ 'down_link_to_graph_avg' ]
+values <- geom_text( aes( x=downAvgsData$scale, y=sum + 0.04 * max( sum ), label = format( sum, digits=3, big.mark = ",", scientific = FALSE ) ), size = 5, fontface = "bold" )
 
 title <- ggtitle( "Port Down Latency" )
-result <- fundamentalGraphData + barGraphFormat + errorBarFormat + title
+result <- fundamentalGraphData + barGraphFormat + errorBarFormat + title + values
 
 
 print( paste( "Saving bar chart with error bars (Port Down Latency) to", errBarOutputFileDown ) )
diff --git a/TestON/JenkinsFile/scripts/SCPFscaleTopo.R b/TestON/JenkinsFile/scripts/SCPFscaleTopo.R
index de22c3a..195019d 100644
--- a/TestON/JenkinsFile/scripts/SCPFscaleTopo.R
+++ b/TestON/JenkinsFile/scripts/SCPFscaleTopo.R
@@ -85,11 +85,10 @@
 dataFrame$type <- factor( dataFrame$type, levels=unique( dataFrame$type ) )
 dataFrame$iterative <- seq( 1, nrow( fileData ), by = 1 )
 
-# Obtain the sum of the averages for the plot size and center of standard deviation bars.
-avgsSum <- fileData$total_time
-
 dataFrame <- na.omit( dataFrame )   # Omit any data that doesn't exist
 
+sum <- fileData[ 'last_role_request_to_last_topology' ] + fileData[ 'last_connection_to_last_role_request' ] + fileData[ 'first_connection_to_last_connection' ]
+
 print( "Data Frame Results:" )
 print( dataFrame )
 
@@ -103,7 +102,6 @@
 #    These are variables that apply to all of the graphs being generated, regardless of type.
 #
 # 2. Type specific graph data is generated.
-#     Data specific for the error bar and stacked bar graphs are generated.
 #
 # 3. Generate and save the graphs.
 #      Graphs are saved to the filename above, in the directory provided in command line args
@@ -129,21 +127,17 @@
 fillLabel <- labs( fill="Type" )
 chartTitle <- paste( "Scale Topology Latency Test" )
 theme <- theme( plot.title=element_text( hjust = 0.5, size = 28, face='bold' ) )
+values <- geom_text( aes( x=dataFrame$iterative, y=sum + 0.02 * max( sum ), label = format( sum, big.mark = ",", scientific = FALSE ), fontface = "bold" ) )
 
 # Store plot configurations as 1 variable
-fundamentalGraphData <- mainPlot + xScaleConfig + xLabel + yLabel + fillLabel + theme
+fundamentalGraphData <- mainPlot + xScaleConfig + xLabel + yLabel + fillLabel + theme + values
 
-# Create the stacked bar graph with error bars.
-# geom_bar contains:
-#    - stat: data formatting (usually "identity")
-#    - width: the width of the bar types (declared above)
-# geom_errorbar contains similar arguments as geom_bar.
-print( "Generating bar graph with error bars." )
+print( "Generating bar graph." )
 barGraphFormat <- geom_bar( stat = "identity", width = width )
 title <- ggtitle( paste( chartTitle, "" ) )
 result <- fundamentalGraphData + barGraphFormat + title
 
 # Save graph to file
-print( paste( "Saving bar chart with error bars to", outputFile ) )
+print( paste( "Saving bar chart to", outputFile ) )
 ggsave( outputFile, width = 10, height = 6, dpi = 200 )
-print( paste( "Successfully wrote bar chart with error bars out to", outputFile ) )
+print( paste( "Successfully wrote bar chart out to", outputFile ) )
diff --git a/TestON/JenkinsFile/scripts/SCPFscalingMaxIntents.R b/TestON/JenkinsFile/scripts/SCPFscalingMaxIntents.R
index bc90806..02f4f28 100644
--- a/TestON/JenkinsFile/scripts/SCPFscalingMaxIntents.R
+++ b/TestON/JenkinsFile/scripts/SCPFscalingMaxIntents.R
@@ -75,7 +75,7 @@
 fileData <- dbGetQuery( con, command )
 
 if ( args[ 1 ] == "y" ){
-    chartTitle <- "Number of Installed Intents & Flows w/ FlowObj"
+    chartTitle <- "Number of Installed Intents & Flows\n with Flow Objectives"
 } else {
     chartTitle <- "Number of Installed Intents & Flows"
 }
@@ -125,8 +125,9 @@
 print( "Generating bar graph bars." )
 width <- 1.3
 barGraphFormat <- geom_bar( stat="identity", position=position_dodge( ), width = width )
+values <- geom_text( aes( x=dataFrame$scale, y=dataFrame$ms + 0.02 * max( dataFrame$ms ), label = format( dataFrame$ms, digits=3, big.mark = ",", scientific = FALSE ) ), size = 3.2, fontface = "bold", position=position_dodge( width=1.25 ) )
 title <- ggtitle( chartTitle )
-result <- fundamentalGraphData + barGraphFormat + title
+result <- fundamentalGraphData + barGraphFormat + title + values
 
 
 print( paste( "Saving bar chart to", outputFile ) )
diff --git a/TestON/JenkinsFile/scripts/SCPFswitchLat.R b/TestON/JenkinsFile/scripts/SCPFswitchLat.R
index 0493859..8a03863 100644
--- a/TestON/JenkinsFile/scripts/SCPFswitchLat.R
+++ b/TestON/JenkinsFile/scripts/SCPFswitchLat.R
@@ -120,32 +120,36 @@
 
 print( "Generating bar graph with error bars (Switch Up Latency)." )
 barGraphFormat <- geom_bar( stat="identity", width = width )
-errorBarFormat <- geom_errorbar( width = width )
-
+errorBarFormat <- geom_errorbar( width = width, color=rgb( 140, 140, 140, maxColorValue=255 ) )
+sum <- fileData[ 'up_device_to_graph_avg' ] + fileData[ 'role_reply_to_device_avg' ] + fileData[ 'role_request_to_role_reply_avg' ] + fileData[ 'feature_reply_to_role_request_avg' ] + fileData[ 'tcp_to_feature_reply_avg' ]
+values <- geom_text( aes( x=upAvgsData$scale, y=sum + 0.04 * max( sum ), label = format( sum, digits=3, big.mark = ",", scientific = FALSE ) ), size = 5, fontface = "bold" )
 title <- ggtitle( "Switch Up Latency" )
-result <- fundamentalGraphData + barGraphFormat + errorBarFormat + title
+result <- fundamentalGraphData + barGraphFormat + errorBarFormat + title + values
 
 
 print( paste( "Saving bar chart with error bars (Switch Up Latency) to", errBarOutputFileUp ) )
 ggsave( errBarOutputFileUp, width = 10, height = 6, dpi = 200 )
 
-
 print( paste( "Successfully wrote bar chart with error bars (Switch Up Latency) out to", errBarOutputFileUp ) )
 
+# Generate switch down latency graph
 
 print( "Generating fundamental graph data (Switch Down Latency)." )
 
 mainPlot <- ggplot( data = downAvgsData, aes( x = scale, y = ms, fill = type, ymin = fileData[ 'down_end_to_end_avg' ] - stds, ymax = fileData[ 'down_end_to_end_avg' ] + stds ) )
 theme <- theme( plot.title=element_text( hjust = 0.5, size = 28, face='bold' ) )
 
+
 fundamentalGraphData <- mainPlot + xScaleConfig + xLabel + yLabel + fillLabel + theme
 
 print( "Generating bar graph with error bars (Switch Down Latency)." )
 barGraphFormat <- geom_bar( stat="identity", width = width )
-errorBarFormat <- geom_errorbar( width = width )
+errorBarFormat <- geom_errorbar( width = width, color=rgb( 140, 140, 140, maxColorValue=255 ) )
 
 title <- ggtitle( "Switch Down Latency" )
-result <- fundamentalGraphData + barGraphFormat + errorBarFormat + title
+sum <- fileData[ 'down_device_to_graph_avg' ] + fileData[ 'ack_to_device_avg' ] + fileData[ 'fin_ack_to_ack_avg' ]
+values <- geom_text( aes( x=downAvgsData$scale, y=sum + 0.04 * max( sum ), label = format( sum, digits=3, big.mark = ",", scientific = FALSE ) ), size = 5, fontface = "bold" )
+result <- fundamentalGraphData + barGraphFormat + errorBarFormat + title + values
 
 
 print( paste( "Saving bar chart with error bars (Switch Down Latency) to", errBarOutputFileDown ) )