Back to home page

Enduro/X

 
 

    


0001 # Create Line Chart
0002 
0003 #write.table(Bench, "Bench.csv")
0004 
0005 # Disable exponential form
0006 options(scipen=999)
0007 
0008 DATA_FILE <- Sys.getenv("NDRX_BENCH_FILE")
0009 XLAB <- Sys.getenv("NDRX_BENCH_X_LABEL")
0010 YLAB <- Sys.getenv("NDRX_BENCH_Y_LABEL")
0011 TITLE <- Sys.getenv("NDRX_BENCH_TITLE")
0012 OUTFILE <- Sys.getenv("NDRX_BENCH_OUTFILE")
0013 
0014 Bench = read.table(DATA_FILE, header = TRUE)
0015 
0016 Bench <- Bench[order(Bench$Configuration),]
0017 
0018 # convert factor to numeric for convenience 
0019 Bench$ConfigurationNum <- as.numeric(Bench$Configuration) 
0020 nConfigurations <- max(Bench$ConfigurationNum)
0021 
0022 # get the range for the x and y axis 
0023 xrange <- range(Bench$MsgSize) 
0024 yrange <- range(Bench$CallsPerSec) 
0025 
0026 #write.csv(Bench$Configuration, file = "Configuration.csv")
0027 #write.csv(nConfigurations, file = "nConfigurations.csv")
0028 
0029 png(filename=OUTFILE, width = 800, height = 480, units = "px", res=80)
0030 
0031 # set up the plot 
0032 #plot(xrange, yrange, type="n", xlab="MsgSize (bytes)",
0033 #        ylab="CallsPerSec (calls/sec)" ) 
0034 
0035 # Add extra space to right of plot area; change clipping to figure
0036 par(mar=c(5.1, 4.1, 4.1, 22.1), xpd=TRUE)
0037 
0038 plot(xrange, yrange, type="n", xlab=XLAB,
0039         ylab=YLAB ) 
0040 
0041 grid()
0042 
0043 colors <- rainbow(nConfigurations) 
0044 linetype <- c(1:nConfigurations) 
0045 plotchar <- seq(18,18+nConfigurations,1)
0046 
0047 # add lines 
0048 for (i in 1:nConfigurations) { 
0049   Configuration <- subset(Bench, ConfigurationNum==i) 
0050   lines(Configuration$MsgSize, Configuration$CallsPerSec, type="b", lwd=1.5,
0051     lty=linetype[i], col=colors[i], pch=plotchar[i]) 
0052 } 
0053 
0054 # add a title and subtitle 
0055 #title("Example graph of benchmarking", "Enduro/X benchmark")
0056 title(TITLE, "Enduro/X Benchmark")
0057 
0058 ux <- unique(Bench$Configuration)
0059 
0060 # add a legend 
0061 #legend(xrange[1], yrange[2], legend=c(1:nConfigurations, cex=0.8, col=colors,
0062 #par(xpd=TRUE)
0063 #legend(xrange[1], yrange[2], legend=ux, cex=0.8, col=colors,
0064 legend("topright", inset=c(-0.8,0), legend=ux, cex=0.8, col=colors,
0065         pch=plotchar, lty=linetype, title="Configuration")
0066