From 00db29f608f3d11a9eef399a8a212cdf72dd650c Mon Sep 17 00:00:00 2001 From: "Morales Quispe, Marcela" Date: Fri, 18 Oct 2019 16:16:31 -0500 Subject: [PATCH] Fix partly #225. Generate a final report for k8s-scaling.json result in diferent subdirectories which follows the current hard-coded test name k8s-scaling. Signed-off-by: Morales Quispe, Marcela --- metrics/report/report_dockerfile/dut-details.R | 1 + metrics/report/report_dockerfile/tidy_scaling.R | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/metrics/report/report_dockerfile/dut-details.R b/metrics/report/report_dockerfile/dut-details.R index 7a707e53..8b360045 100755 --- a/metrics/report/report_dockerfile/dut-details.R +++ b/metrics/report/report_dockerfile/dut-details.R @@ -77,6 +77,7 @@ for (currentdir in resultdirs) { if ( length(dirstats) == 0 ) { warning(paste("No valid data found for directory ", currentdir)) + break } # use plyr rbind.fill so we can combine disparate version info frames diff --git a/metrics/report/report_dockerfile/tidy_scaling.R b/metrics/report/report_dockerfile/tidy_scaling.R index 3e56d995..ed45c32f 100755 --- a/metrics/report/report_dockerfile/tidy_scaling.R +++ b/metrics/report/report_dockerfile/tidy_scaling.R @@ -43,13 +43,19 @@ for (currentdir in resultdirs) { next } + # Check if filename follows the hard-coded test name + shortname=substr(ffound, 1, nchar(ffound)-nchar(".json")) + if ( substr(testname, 1, nchar(testname)-nchar(".*")) != shortname) { + warning(paste("Result file name does not match with test name: ", shortname)) + break + } + # Derive the name from the test result dirname datasetname=basename(currentdir) # Import the data fdata=fromJSON(fname) # De-nest the test name specific data - shortname=substr(ffound, 1, nchar(ffound)-nchar(".json")) fdata=fdata[[shortname]] testname=datasetname @@ -195,8 +201,12 @@ for (currentdir in resultdirs) { # And collect up our rows into our global table of all results # These two tables *should* be the source of all the data we need to # process and plot (apart from the stats....) - bootdata=rbind(bootdata, local_bootdata, make.row.names=FALSE) - nodedata=rbind(nodedata, local_nodedata, make.row.names=FALSE) + if ( exists("local_bootdata") ) { + bootdata=rbind(bootdata, local_bootdata, make.row.names=FALSE) + nodedata=rbind(nodedata, local_nodedata, make.row.names=FALSE) + } else { + warning(paste("Could not able to create report for: ", ffound)) + } } }