Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 1 | # Copyright 2017 Open Networking Foundation (ONF) |
| 2 | # |
| 3 | # Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>, |
| 4 | # the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>, |
| 5 | # or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg> |
| 6 | # |
| 7 | # TestON is free software: you can redistribute it and/or modify |
| 8 | # it under the terms of the GNU General Public License as published by |
| 9 | # the Free Software Foundation, either version 2 of the License, or |
| 10 | # (at your option) any later version. |
| 11 | # |
| 12 | # TestON is distributed in the hope that it will be useful, |
| 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | # GNU General Public License for more details. |
| 16 | # |
| 17 | # You should have received a copy of the GNU General Public License |
| 18 | # along with TestON. If not, see <http://www.gnu.org/licenses/>. |
| 19 | # |
| 20 | # If you have any questions, or if you don't understand R, |
Jeremy Ronquillo | b626884 | 2017-10-03 13:02:58 -0700 | [diff] [blame] | 21 | # please contact Jeremy Ronquillo: j_ronquillo@u.pacific.edu |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 22 | |
| 23 | # ********************************************************** |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 24 | # STEP 1: Data management. |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 25 | # ********************************************************** |
Devin Lim | 0e96716 | 2017-11-03 15:59:53 -0700 | [diff] [blame] | 26 | has_flow_obj = 1 |
| 27 | database_host = 2 |
| 28 | database_port = 3 |
| 29 | database_u_id = 4 |
| 30 | database_pw = 5 |
| 31 | test_name = 6 |
| 32 | branch_name = 7 |
| 33 | has_neighbors = 8 |
| 34 | old_flow = 9 |
| 35 | save_directory = 10 |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 36 | |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 37 | print( "**********************************************************" ) |
| 38 | print( "STEP 1: Data management." ) |
| 39 | print( "**********************************************************" ) |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 40 | |
Jeremy Ronquillo | b626884 | 2017-10-03 13:02:58 -0700 | [diff] [blame] | 41 | # Command line arguments are read. |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 42 | print( "Reading commmand-line args." ) |
| 43 | args <- commandArgs( trailingOnly=TRUE ) |
| 44 | |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 45 | # ---------------- |
| 46 | # Import Libraries |
| 47 | # ---------------- |
| 48 | |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 49 | print( "Importing libraries." ) |
| 50 | library( ggplot2 ) |
| 51 | library( reshape2 ) |
| 52 | library( RPostgreSQL ) # For databases |
| 53 | |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 54 | # ------------------- |
| 55 | # Check CLI Arguments |
| 56 | # ------------------- |
| 57 | |
| 58 | print( "Verifying CLI args." ) |
| 59 | |
Devin Lim | 0e96716 | 2017-11-03 15:59:53 -0700 | [diff] [blame] | 60 | if ( is.na( args[ save_directory ] ) ){ |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 61 | |
| 62 | print( paste( "Usage: Rscript SCPFflowTp1g.R", |
| 63 | "<has-flow-obj>", |
| 64 | "<database-host>", |
| 65 | "<database-port>", |
| 66 | "<database-user-id>", |
| 67 | "<database-password>", |
| 68 | "<test-name>", |
| 69 | "<branch-name>", |
| 70 | "<has-neighbors>", |
Devin Lim | 0e96716 | 2017-11-03 15:59:53 -0700 | [diff] [blame] | 71 | "<using-old-flow>", |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 72 | "<directory-to-save-graphs>", |
| 73 | sep=" " ) ) |
| 74 | |
Jeremy Ronquillo | 9ea85d0 | 2017-11-27 10:21:03 -0800 | [diff] [blame] | 75 | quit( status = 1 ) # basically exit(), but in R |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 76 | } |
| 77 | |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 78 | # ----------------- |
| 79 | # Create File Names |
| 80 | # ----------------- |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 81 | |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 82 | print( "Creating filenames and title of graph." ) |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 83 | |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 84 | chartTitle <- "Flow Throughput Test" |
| 85 | fileNeighborsModifier <- "no" |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 86 | commandNeighborModifier <- "" |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 87 | fileFlowObjModifier <- "" |
| 88 | sqlFlowObjModifier <- "" |
Devin Lim | 0e96716 | 2017-11-03 15:59:53 -0700 | [diff] [blame] | 89 | if ( args[ has_flow_obj ] == 'y' ){ |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 90 | fileFlowObjModifier <- "_flowObj" |
| 91 | sqlFlowObjModifier <- "_fobj" |
| 92 | chartTitle <- paste( chartTitle, " with Flow Objectives", sep="" ) |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 93 | } |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 94 | |
| 95 | chartTitle <- paste( chartTitle, "\nNeighbors =", sep="" ) |
| 96 | |
Devin Lim | 0e96716 | 2017-11-03 15:59:53 -0700 | [diff] [blame] | 97 | fileOldFlowModifier <- "" |
| 98 | if ( args[ has_neighbors ] == 'y' ){ |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 99 | fileNeighborsModifier <- "all" |
Jeremy Ronquillo | 2d2649d | 2017-09-14 12:53:06 -0700 | [diff] [blame] | 100 | commandNeighborModifier <- "scale=1 OR NOT " |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 101 | chartTitle <- paste( chartTitle, "Cluster Size - 1" ) |
| 102 | } else { |
| 103 | chartTitle <- paste( chartTitle, "0" ) |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 104 | } |
Devin Lim | 0e96716 | 2017-11-03 15:59:53 -0700 | [diff] [blame] | 105 | if ( args[ old_flow ] == 'y' ){ |
| 106 | fileOldFlowModifier <- "_OldFlow" |
Devin Lim | 1bba762 | 2017-11-14 16:31:41 -0800 | [diff] [blame] | 107 | chartTitle <- paste( chartTitle, "With Eventually Consistent Flow Rule Store", sep="\n" ) |
Devin Lim | 0e96716 | 2017-11-03 15:59:53 -0700 | [diff] [blame] | 108 | } |
| 109 | errBarOutputFile <- paste( args[ save_directory ], |
| 110 | args[ test_name ], |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 111 | "_", |
Devin Lim | 0e96716 | 2017-11-03 15:59:53 -0700 | [diff] [blame] | 112 | args[ branch_name ], |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 113 | "_", |
| 114 | fileNeighborsModifier, |
| 115 | "-neighbors", |
| 116 | fileFlowObjModifier, |
Devin Lim | 0e96716 | 2017-11-03 15:59:53 -0700 | [diff] [blame] | 117 | fileOldFlowModifier, |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 118 | "_graph.jpg", |
| 119 | sep="" ) |
| 120 | # ------------------ |
| 121 | # SQL Initialization |
| 122 | # ------------------ |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 123 | |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 124 | print( "Initializing SQL" ) |
| 125 | |
| 126 | con <- dbConnect( dbDriver( "PostgreSQL" ), |
| 127 | dbname = "onostest", |
Devin Lim | 0e96716 | 2017-11-03 15:59:53 -0700 | [diff] [blame] | 128 | host = args[ database_host ], |
| 129 | port = strtoi( args[ database_port ] ), |
| 130 | user = args[ database_u_id ], |
| 131 | password = args[ database_pw ] ) |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 132 | |
| 133 | # --------------------------- |
| 134 | # Flow Throughput SQL Command |
| 135 | # --------------------------- |
| 136 | |
| 137 | print( "Generating Flow Throughput SQL command." ) |
| 138 | |
| 139 | command <- paste( "SELECT scale, avg( avg ), avg( std ) FROM flow_tp", |
| 140 | sqlFlowObjModifier, |
| 141 | "_tests WHERE (", |
| 142 | commandNeighborModifier, |
| 143 | "neighbors = 0 ) AND branch = '", |
Devin Lim | 0e96716 | 2017-11-03 15:59:53 -0700 | [diff] [blame] | 144 | args[ branch_name ], |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 145 | "' AND date IN ( SELECT max( date ) FROM flow_tp", |
| 146 | sqlFlowObjModifier, |
| 147 | "_tests WHERE branch='", |
Devin Lim | 0e96716 | 2017-11-03 15:59:53 -0700 | [diff] [blame] | 148 | args[ branch_name ], |
| 149 | "' AND ", |
| 150 | ( if( args[ old_flow ] == 'y' ) "" else "NOT " ), |
| 151 | "is_old_flow", |
| 152 | " ) GROUP BY scale ORDER BY scale", |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 153 | sep="" ) |
| 154 | |
| 155 | print( "Sending SQL command:" ) |
| 156 | print( command ) |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 157 | |
| 158 | fileData <- dbGetQuery( con, command ) |
| 159 | |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 160 | # ********************************************************** |
| 161 | # STEP 2: Organize data. |
| 162 | # ********************************************************** |
| 163 | |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 164 | print( "**********************************************************" ) |
| 165 | print( "STEP 2: Organize Data." ) |
| 166 | print( "**********************************************************" ) |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 167 | |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 168 | # ------------ |
| 169 | # Data Sorting |
| 170 | # ------------ |
| 171 | |
| 172 | print( "Sorting data for Flow Throughput." ) |
| 173 | |
| 174 | colnames( fileData ) <- c( "scale", |
| 175 | "avg", |
| 176 | "std" ) |
| 177 | |
Jeremy Ronquillo | 9ea85d0 | 2017-11-27 10:21:03 -0800 | [diff] [blame] | 178 | requiredColumns <- c( "avg" ) |
| 179 | |
| 180 | tryCatch( avgs <- c( fileData[ requiredColumns] ), |
| 181 | error = function( e ) { |
| 182 | print( "[ERROR] One or more expected columns are missing from the data. Please check that the data and SQL command are valid, then try again." ) |
| 183 | print( "Required columns: " ) |
| 184 | print( requiredColumns ) |
| 185 | print( "Actual columns: " ) |
| 186 | print( names( fileData ) ) |
| 187 | print( "Error dump:" ) |
| 188 | print( e ) |
| 189 | quit( status = 1 ) |
| 190 | } |
| 191 | ) |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 192 | |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 193 | |
| 194 | # ---------------------------- |
| 195 | # Flow TP Construct Data Frame |
| 196 | # ---------------------------- |
| 197 | |
| 198 | print( "Constructing Flow TP data frame." ) |
| 199 | |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 200 | dataFrame <- melt( avgs ) # This is where reshape2 comes in. Avgs list is converted to data frame |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 201 | dataFrame$scale <- fileData$scale # Add node scaling to the data frame. |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 202 | dataFrame$std <- fileData$std |
| 203 | |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 204 | colnames( dataFrame ) <- c( "throughput", |
| 205 | "type", |
| 206 | "scale", |
| 207 | "std" ) |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 208 | |
Jeremy Ronquillo | 2d2649d | 2017-09-14 12:53:06 -0700 | [diff] [blame] | 209 | dataFrame <- na.omit( dataFrame ) # Omit any data that doesn't exist |
| 210 | |
| 211 | print( "Data Frame Results:" ) |
| 212 | print( dataFrame ) |
| 213 | |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 214 | # ********************************************************** |
| 215 | # STEP 3: Generate graphs. |
| 216 | # ********************************************************** |
| 217 | |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 218 | print( "**********************************************************" ) |
| 219 | print( "STEP 3: Generate Graph." ) |
| 220 | print( "**********************************************************" ) |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 221 | |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 222 | # ------------------ |
| 223 | # Generate Main Plot |
| 224 | # ------------------ |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 225 | |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 226 | print( "Generating main plot." ) |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 227 | # Create the primary plot here. |
| 228 | # ggplot contains the following arguments: |
| 229 | # - data: the data frame that the graph will be based off of |
| 230 | # - aes: the asthetics of the graph which require: |
| 231 | # - x: x-axis values (usually node scaling) |
| 232 | # - y: y-axis values (usually time in milliseconds) |
| 233 | # - fill: the category of the colored side-by-side bars (usually type) |
Jeremy Ronquillo | 2d2649d | 2017-09-14 12:53:06 -0700 | [diff] [blame] | 234 | |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 235 | mainPlot <- ggplot( data = dataFrame, aes( x = scale, |
| 236 | y = throughput, |
| 237 | ymin = throughput, |
| 238 | ymax = throughput + std, |
| 239 | fill = type ) ) |
| 240 | # ------------------------------ |
| 241 | # Fundamental Variables Assigned |
| 242 | # ------------------------------ |
Jeremy Ronquillo | 2d2649d | 2017-09-14 12:53:06 -0700 | [diff] [blame] | 243 | |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 244 | print( "Generating fundamental graph data." ) |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 245 | |
| 246 | # Formatting the plot |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 247 | theme_set( theme_grey( base_size = 22 ) ) # set the default text size of the graph. |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 248 | width <- 0.7 # Width of the bars. |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 249 | xScaleConfig <- scale_x_continuous( breaks = dataFrame$scale, |
| 250 | label = dataFrame$scale ) |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 251 | xLabel <- xlab( "Scale" ) |
Jeremy Ronquillo | 1bdaae5 | 2017-09-22 11:39:48 -0700 | [diff] [blame] | 252 | yLabel <- ylab( "Throughput (,000 Flows/sec)" ) |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 253 | fillLabel <- labs( fill="Type" ) |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 254 | imageWidth <- 15 |
| 255 | imageHeight <- 10 |
| 256 | imageDPI <- 200 |
| 257 | errorBarColor <- rgb( 140, 140, 140, maxColorValue=255 ) |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 258 | |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 259 | theme <- theme( plot.title = element_text( hjust = 0.5, |
| 260 | size = 32, |
Jeremy Ronquillo | 94f99dd | 2018-01-05 11:11:27 -0800 | [diff] [blame] | 261 | face = 'bold' ), |
| 262 | plot.subtitle = element_text( size=16, hjust=1.0 ) ) |
| 263 | |
| 264 | subtitle <- paste( "Last Updated: ", format( Sys.time(), format = "%b %d, %Y at %I:%M %p %Z" ), sep="" ) |
| 265 | |
| 266 | title <- labs( title = chartTitle, subtitle = subtitle ) |
Jeremy Ronquillo | 4363d09 | 2017-10-13 13:28:47 -0700 | [diff] [blame] | 267 | |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 268 | # Store plot configurations as 1 variable |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 269 | fundamentalGraphData <- mainPlot + |
| 270 | xScaleConfig + |
| 271 | xLabel + |
| 272 | yLabel + |
| 273 | fillLabel + |
| 274 | theme + |
| 275 | title |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 276 | |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 277 | # --------------------------- |
| 278 | # Generating Bar Graph Format |
| 279 | # --------------------------- |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 280 | |
| 281 | # Create the stacked bar graph with error bars. |
| 282 | # geom_bar contains: |
| 283 | # - stat: data formatting (usually "identity") |
| 284 | # - width: the width of the bar types (declared above) |
| 285 | # geom_errorbar contains similar arguments as geom_bar. |
| 286 | print( "Generating bar graph with error bars." ) |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 287 | barGraphFormat <- geom_bar( stat = "identity", |
| 288 | width = width, |
| 289 | fill = "#FFAA3C" ) |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 290 | |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 291 | errorBarFormat <- geom_errorbar( width = width, |
| 292 | position = position_dodge(), |
| 293 | color = errorBarColor ) |
| 294 | |
| 295 | values <- geom_text( aes( x = dataFrame$scale, |
| 296 | y = dataFrame$throughput + 0.03 * max( dataFrame$throughput ), |
| 297 | label = format( dataFrame$throughput, |
| 298 | digits=3, |
| 299 | big.mark = ",", |
| 300 | scientific = FALSE ) ), |
| 301 | size = 7.0, |
| 302 | fontface = "bold" ) |
| 303 | |
| 304 | result <- fundamentalGraphData + |
| 305 | barGraphFormat + |
| 306 | errorBarFormat + |
| 307 | values |
| 308 | |
| 309 | # ----------------------- |
| 310 | # Exporting Graph to File |
| 311 | # ----------------------- |
| 312 | |
Jeremy Ronquillo | 6df8781 | 2017-08-28 16:17:36 +0000 | [diff] [blame] | 313 | print( paste( "Saving bar chart with error bars to", errBarOutputFile ) ) |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 314 | |
Jeremy Ronquillo | 9ea85d0 | 2017-11-27 10:21:03 -0800 | [diff] [blame] | 315 | tryCatch( ggsave( errBarOutputFile, |
| 316 | width = imageWidth, |
| 317 | height = imageHeight, |
| 318 | dpi = imageDPI ), |
| 319 | error = function( e ){ |
| 320 | print( "[ERROR] There was a problem saving the graph due to a graph formatting exception. Error dump:" ) |
| 321 | print( e ) |
| 322 | quit( status = 1 ) |
| 323 | } |
| 324 | ) |
Jeremy Ronquillo | 7673f80 | 2017-10-30 09:42:44 -0700 | [diff] [blame] | 325 | |
| 326 | print( paste( "[SUCCESS] Successfully wrote bar chart with error bars out to", errBarOutputFile ) ) |
Jeremy Ronquillo | 9ea85d0 | 2017-11-27 10:21:03 -0800 | [diff] [blame] | 327 | quit( status = 0 ) |