From acf5a951776a57d332c277478b707cca460f6fbb Mon Sep 17 00:00:00 2001 From: Graham Whaley Date: Mon, 25 Nov 2019 10:30:27 +0000 Subject: [PATCH] metrics: tidy: move local assign inside loop The bootdata assignments were outside the 'valid file' check loop, which meant in the case there was a data directory which did not contain a valid scaling file, we would fail the assignment (as the `local_bootdata` would be empty). Fix by moving the assignments into the loop, thus only assigning when we know we have valid data. Signed-off-by: Graham Whaley --- metrics/report/report_dockerfile/tidy_scaling.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/metrics/report/report_dockerfile/tidy_scaling.R b/metrics/report/report_dockerfile/tidy_scaling.R index 3e56d99..04eb9e5 100755 --- a/metrics/report/report_dockerfile/tidy_scaling.R +++ b/metrics/report/report_dockerfile/tidy_scaling.R @@ -190,13 +190,13 @@ for (currentdir in resultdirs) { "avg_inode"=round(inodetotal/num_pods, 4) ) inodestats=rbind(inodestats, local_inodes) - } - # 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) + # 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) + } } }