Skip to content

Commit

Permalink
benchmark: improve compare output
Browse files Browse the repository at this point in the history
The current output uses JSON.stringify to escape the config values.
This switches to util.inspect to have a better readable output.

PR-URL: nodejs#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>
  • Loading branch information
BridgeAR authored and MayaLekova committed May 8, 2018
1 parent 7513eec commit 11bc671
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions benchmark/compare.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 11bc671

Please sign in to comment.