benchmark: fixes csv parsing given no parameters

When a benchmark did not contain any parameters the csv configuration
filed would be "". In R this is by default parsed as NA, causing NA in
the printout too.

Fixes: https://github.com/nodejs/node/issues/9061
PR-URL: https://github.com/nodejs/node/pull/9064
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
This commit is contained in:
Andreas Madsen 2016-10-12 20:23:40 +02:00 committed by James M Snell
parent 3d294cf0c4
commit 138a7922ce

View File

@ -16,8 +16,12 @@ if (!is.null(args.options$help) ||
plot.filename = args.options$plot;
dat = read.csv(file('stdin'));
dat = read.csv(
file('stdin'),
colClasses=c('character', 'character', 'character', 'numeric', 'numeric')
);
dat = data.frame(dat);
dat$nameTwoLines = paste0(dat$filename, '\n', dat$configuration);
dat$name = paste0(dat$filename, dat$configuration);