From b4bab3b403e5ef0cd2ec104f2bbb7ef8c835fe50 Mon Sep 17 00:00:00 2001 From: Conor <43864112+ConorDavenport@users.noreply.github.com> Date: Mon, 27 Apr 2020 17:38:59 +0100 Subject: [PATCH] Print next step recommendation to console (#229) * print next step recommendation to console * update messages * add check for collect only argument * remove whitespace --- bin.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/bin.js b/bin.js index dffc4f3..43a3c5f 100755 --- a/bin.js +++ b/bin.js @@ -611,6 +611,27 @@ async function runTool (args, Tool, version, uiOptions) { console.log(`Output file is ${outputs.data}`) } + if (Tool.name === 'ClinicDoctor' && !args['collect-only']) { + try { + const iss = tool.getIssue() + const proc = args['--'][args['--'].length - 1] + if (iss !== 'none') { + console.log(`Doctor detected a potential ${iss} issue.`) + } + if (iss === 'event-loop') { + console.log('To get started with diagnosing the issue run:') + console.log(`clinic flame --autocannon [ / ] -- node ${proc}`) + } else if (iss === 'io') { + console.log('To get started with diagnosing the issue run:') + console.log(`clinic bubbleprof --autocannon [ / ] -- node ${proc}`) + } else if (iss === 'data') { + console.log('Try running the benchmark for a longer time.') + } + } catch (err) { + // The version of Doctor used does not have a getIssue() function + } + } + // rest is util functions function viz (filename, cb) {