Improving timestamps of OnosSystemTest wiki graphs

Change-Id: I593e50506932d8ddacfff76a1feceb8ef2c1ca67
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFbatchFlowResp.R b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFbatchFlowResp.R
index 66dc505..1bcf551 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFbatchFlowResp.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFbatchFlowResp.R
@@ -129,6 +129,8 @@
 print( "STEP 2: Organize Data." )
 print( "**********************************************************" )
 
+latestBuildDate <- fileData$date[1]
+
 # -----------------
 # Post Data Sorting
 # -----------------
@@ -270,7 +272,7 @@
 xScaleConfig <- scale_x_continuous( breaks = postDataFrame$iterative,
                                     label = postDataFrame$date )
 
-title <- labs( title = postChartTitle, subtitle = lastUpdatedLabel() )
+title <- labs( title = postChartTitle, subtitle = lastUpdatedLabel( latestBuildDate ) )
 
 fundamentalGraphData <- mainPlot +
                         xScaleConfig +
@@ -329,7 +331,7 @@
 xScaleConfig <- scale_x_continuous( breaks = delDataFrame$iterative,
                                     label = delDataFrame$date )
 
-title <- labs( title = delChartTitle, subtitle = lastUpdatedLabel() )
+title <- labs( title = delChartTitle, subtitle = lastUpdatedLabel( latestBuildDate ) )
 
 fundamentalGraphData <- mainPlot +
                         xScaleConfig +
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFcbench.R b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFcbench.R
index 7e8e8c2..940a14b 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFcbench.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFcbench.R
@@ -106,6 +106,8 @@
 print( "STEP 2: Organize Data." )
 print( "**********************************************************" )
 
+latestBuildDate <- fileData$date[1]
+
 # ------------
 # Data Sorting
 # ------------
@@ -187,7 +189,7 @@
 
 theme <- graphTheme()
 
-title <- labs( title = chartTitle, subtitle = lastUpdatedLabel() )
+title <- labs( title = chartTitle, subtitle = lastUpdatedLabel( latestBuildDate ) )
 
 fundamentalGraphData <- mainPlot +
                         xScaleConfig +
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFhostLat.R b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFhostLat.R
index b34010a..b82f255 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFhostLat.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFhostLat.R
@@ -107,6 +107,8 @@
 print( "STEP 2: Organize Data." )
 print( "**********************************************************" )
 
+latestBuildDate <- fileData$date[1]
+
 # ------------
 # Data Sorting
 # ------------
@@ -185,7 +187,7 @@
 
 theme <- graphTheme()
 
-title <- labs( title = chartTitle, subtitle = lastUpdatedLabel() )
+title <- labs( title = chartTitle, subtitle = lastUpdatedLabel( latestBuildDate ) )
 
 errorBarColor <- rgb( 140, 140, 140, maxColorValue = 255 )
 
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFmastershipFailoverLat.R b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFmastershipFailoverLat.R
index c6e3503..2eb4145 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFmastershipFailoverLat.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFmastershipFailoverLat.R
@@ -115,6 +115,8 @@
 print( "STEP 2: Organize Data." )
 print( "**********************************************************" )
 
+latestBuildDate <- fileData$date[1]
+
 # ------------
 # Data Sorting
 # ------------
@@ -209,7 +211,7 @@
 
 print( "Generating fundamental graph data for the error bar graph." )
 
-title <- labs( title = chartTitle, subtitle = lastUpdatedLabel() )
+title <- labs( title = chartTitle, subtitle = lastUpdatedLabel( latestBuildDate ) )
 
 fundamentalGraphData <- mainPlot +
                         xScaleConfig +
@@ -262,7 +264,7 @@
 
 print( "Generating fundamental graph data for the stacked bar graph." )
 
-title <- labs( title = chartTitle, subtitle = lastUpdatedLabel() )
+title <- labs( title = chartTitle, subtitle = lastUpdatedLabel( latestBuildDate ) )
 
 fundamentalGraphData <- mainPlot +
                         xScaleConfig +
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFportLat.R b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFportLat.R
index dd3d95d..6311df7 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFportLat.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFportLat.R
@@ -110,6 +110,8 @@
 print( "STEP 2: Organize Data." )
 print( "**********************************************************" )
 
+latestBuildDate <- fileData$date[1]
+
 # -----------------------------
 # Port Up Averages Data Sorting
 # -----------------------------
@@ -233,7 +235,7 @@
 
 theme <- graphTheme()
 
-subtitle <- lastUpdatedLabel()
+subtitle <- lastUpdatedLabel( latestBuildDate )
 
 colors <- scale_fill_manual( values=c( webColor( "redv2" ),
                                        webColor( "light_blue" ),
@@ -259,7 +261,7 @@
 
 print( "Generating fundamental graph data (Port Up Latency)." )
 
-title <- labs( title = "Port Up Latency", subtitle = lastUpdatedLabel() )
+title <- labs( title = "Port Up Latency", subtitle = lastUpdatedLabel( latestBuildDate ) )
 
 fundamentalGraphData <- mainPlot +
                         xScaleConfig +
@@ -321,7 +323,7 @@
 
 print( "Generating fundamental graph data (Port Down Latency)." )
 
-title <- labs( title = "Port Down Latency", subtitle = lastUpdatedLabel() )
+title <- labs( title = "Port Down Latency", subtitle = lastUpdatedLabel( latestBuildDate ) )
 
 fundamentalGraphData <- mainPlot +
                         xScaleConfig +
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFscaleTopo.R b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFscaleTopo.R
index 0a03b3a..7684a5f 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFscaleTopo.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFscaleTopo.R
@@ -108,6 +108,8 @@
 print( "STEP 2: Organize Data." )
 print( "**********************************************************" )
 
+latestBuildDate <- fileData$date[1]
+
 # ------------
 # Data Sorting
 # ------------
@@ -205,7 +207,7 @@
 
 wrapLegend <- guides( fill = guide_legend( nrow=2, byrow=TRUE ) )
 
-title <- labs( title = chartTitle, subtitle = lastUpdatedLabel() )
+title <- labs( title = chartTitle, subtitle = lastUpdatedLabel( latestBuildDate ) )
 
 # Store plot configurations as 1 variable
 fundamentalGraphData <- mainPlot +
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFswitchLat.R b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFswitchLat.R
index 8082c4a..679d205 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFswitchLat.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFswitchLat.R
@@ -110,6 +110,8 @@
 print( "STEP 2: Organize Data." )
 print( "**********************************************************" )
 
+latestBuildDate <- fileData$date[1]
+
 # -------------------------------
 # Switch Up Averages Data Sorting
 # -------------------------------
@@ -234,7 +236,7 @@
 
 theme <- graphTheme()
 
-subtitle <- lastUpdatedLabel()
+subtitle <- lastUpdatedLabel( latestBuildDate )
 
 colors <- scale_fill_manual( values=c( webColor( "redv2" ),
                                        webColor( "light_blue" ),
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R b/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R
index 820c538..4ec580f 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R
@@ -51,10 +51,10 @@
     guides( color = guide_legend( nrow = 2, byrow = byrow ) )
 }
 
-lastUpdatedLabel <- function(){
-    paste( "Last Updated: ", format( Sys.time(), format = "%b %d, %Y at %I:%M %p %Z" ), sep="" )
+lastUpdatedLabel <- function( latestBuildDate ){
+    paste( "Last Updated: ", format( latestBuildDate, "%b %d, %Y at %I:%M %p %Z" ), sep="" )
 }
 
 defaultTextSize <- function(){
     theme_set( theme_grey( base_size = 26 ) )   # set the default text size of the graph.
-}
\ No newline at end of file
+}
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/histogramMultipleTestGroups.R b/TestON/JenkinsFile/wikiGraphRScripts/histogramMultipleTestGroups.R
index 78c3fe0..ef2d153 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/histogramMultipleTestGroups.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/histogramMultipleTestGroups.R
@@ -269,7 +269,7 @@
 
 theme <- graphTheme() + theme( axis.text.x = element_text( angle = 0, size = 25 - 1.25 * length( dbResults ) ) )
 
-title <- labs( title = title, subtitle = lastUpdatedLabel() )
+title <- labs( title = title, subtitle = lastUpdatedLabel( Sys.time() ) )
 
 # Store plot configurations as 1 variable
 fundamentalGraphData <- mainPlot +
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/pieMultipleTests.R b/TestON/JenkinsFile/wikiGraphRScripts/pieMultipleTests.R
index 46f671f..2b430ea 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/pieMultipleTests.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/pieMultipleTests.R
@@ -243,7 +243,7 @@
                 panel.grid=element_blank(),
                 legend.position = "bottom" )
 
-title <- labs( title = title, subtitle = lastUpdatedLabel() )
+title <- labs( title = title, subtitle = lastUpdatedLabel( Sys.time() ) )
 
 # Store plot configurations as 1 variable
 fundamentalGraphData <- mainPlot +
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/trendCHO.R b/TestON/JenkinsFile/wikiGraphRScripts/trendCHO.R
index b1ef7a7..3b1ac6c 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/trendCHO.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/trendCHO.R
@@ -453,7 +453,7 @@
                                               "ONOS Up" )
                                 )
 
-title <- labs( title = eventsTitle, subtitle = lastUpdatedLabel() )
+title <- labs( title = eventsTitle, subtitle = lastUpdatedLabel( Sys.time() ) )
 
 result <- eventsPlot +
           xScaleConfig +
@@ -496,7 +496,7 @@
                                               "ONOS Check Failure" )
                                 )
 
-title <- labs( title = failedChecksTitle, subtitle = lastUpdatedLabel() )
+title <- labs( title = failedChecksTitle, subtitle = lastUpdatedLabel( Sys.time() ) )
 
 result <- failuresPlot +
           xScaleConfig +
@@ -538,7 +538,7 @@
                                               "Exceptions" )
                                 )
 
-title <- labs( title = errorsTitle, subtitle = lastUpdatedLabel() )
+title <- labs( title = errorsTitle, subtitle = lastUpdatedLabel( Sys.time() ) )
 
 result <- errorsPlot +
           xScaleConfig +
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/trendIndividualTest.R b/TestON/JenkinsFile/wikiGraphRScripts/trendIndividualTest.R
index 93d58ed..5cc5c35 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/trendIndividualTest.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/trendIndividualTest.R
@@ -143,6 +143,8 @@
 
 print( "Constructing data frame from combined data." )
 
+latestBuildDate <- fileData$date[1]
+
 dataFrame <- melt( categories )
 
 # Rename column names in dataFrame
@@ -238,7 +240,7 @@
                                                    "Passed Cases",
                                                    "Planned Cases" ) )
 
-title <- labs( title = title, subtitle = lastUpdatedLabel() )
+title <- labs( title = title, subtitle = lastUpdatedLabel( latestBuildDate ) )
 
 # Store plot configurations as 1 variable
 fundamentalGraphData <- mainPlot +
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/trendMultipleTests.R b/TestON/JenkinsFile/wikiGraphRScripts/trendMultipleTests.R
index f85477b..ebe5c43 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/trendMultipleTests.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/trendMultipleTests.R
@@ -222,7 +222,7 @@
 
 theme <- graphTheme()
 
-title <- labs( title = title, subtitle = lastUpdatedLabel() )
+title <- labs( title = title, subtitle = lastUpdatedLabel( Sys.time() ) )
 
 # Store plot configurations as 1 variable
 fundamentalGraphData <- mainPlot +
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/trendSCPF.R b/TestON/JenkinsFile/wikiGraphRScripts/trendSCPF.R
index 0a4968a..40a20f4 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/trendSCPF.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/trendSCPF.R
@@ -112,6 +112,8 @@
 print( "STEP 2: Organize Data." )
 print( "**********************************************************" )
 
+latestBuildDate <- fileData$date[1]
+
 # Create lists c() and organize data into their corresponding list.
 print( "Combine data retrieved from databases into a list." )
 
@@ -206,7 +208,7 @@
 # Set other graph configurations here.
 theme <- graphTheme()
 
-title <- labs( title = title, subtitle = lastUpdatedLabel() )
+title <- labs( title = title, subtitle = lastUpdatedLabel( latestBuildDate ) )
 
 # Colors used for the lines.
 # Note: graphs that have X lines will use the first X colors in this list.