benchmark: improve compare output

The current output uses JSON.stringify to escape the config values.
This switches to util.inspect to have a better readable output.

PR-URL: https://github.com/nodejs/node/pull/18597
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Ruben Bridgewater 2018-02-05 19:49:50 +01:00 committed by Anatoli Papirovski
parent 86c659ba61
commit 809af1fe8a
No known key found for this signature in database
GPG Key ID: 614E2E1ABEB4B2C0

View File

@ -1,6 +1,7 @@
'use strict';
const fork = require('child_process').fork;
const { fork } = require('child_process');
const { inspect } = require('util');
const path = require('path');
const CLI = require('./_cli.js');
const BenchmarkProgress = require('./_benchmark_progress.js');
@ -76,7 +77,7 @@ if (showProgress) {
// Construct configuration string, " A=a, B=b, ..."
let conf = '';
for (const key of Object.keys(data.conf)) {
conf += ` ${key}=${JSON.stringify(data.conf[key])}`;
conf += ` ${key}=${inspect(data.conf[key])}`;
}
conf = conf.slice(1);
// Escape quotes (") for correct csv formatting