mirror of
https://github.com/clinicjs/node-clinic.git
synced 2026-01-18 16:22:03 +00:00
Print next step recommendation to console (#229)
* print next step recommendation to console * update messages * add check for collect only argument * remove whitespace
This commit is contained in:
parent
9f1e90ff09
commit
b4bab3b403
21
bin.js
21
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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user