diff --git a/.gitignore b/.gitignore index 61061d9a..a1d48933 100644 --- a/.gitignore +++ b/.gitignore @@ -65,3 +65,5 @@ typings/ .vscode # IntelliJ Idea .idea +# Mac OS +.DS_Store diff --git a/README.md b/README.md index d529e952..14daab73 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,7 @@ clinic ask --help -h | --help Display Help -v | --version Display Version --collect-only Do not process data on termination +--collect-delay Specify a delay(ms) before collecting data. --visualize-only datapath Build or rebuild visualization from data --on-port Run a script when the server starts listening on a port. --autocannon Run the autocannon benchmarking tool when the server starts listening on a port. diff --git a/bin.js b/bin.js index 731b3b6a..55f46e96 100755 --- a/bin.js +++ b/bin.js @@ -351,7 +351,7 @@ const result = commist() })) .register('flame', catchify(async function (argv) { const version = require('@nearform/flame/version') - checkArgs(argv, 'clinic-bubbleprof', version) + checkArgs(argv, 'clinic-flame', version) const args = subarg(argv, { alias: { @@ -482,9 +482,16 @@ async function runTool (args, Tool, version, uiOptions) { } } + // Validate usage of on-port flag + if (args['on-port'] > 0 && onPort) { + console.log('You must provide on-port with the autocannon config') + process.exit(0) + } + const openLocalFile = args.open && !args.upload const tool = new Tool({ + collectDelay: parseInt(args['collect-delay'], 10), sampleInterval: parseInt(args['sample-interval'], 10), detectPort: !!onPort, dest: args.dest, diff --git a/docs/clinic-doctor.txt b/docs/clinic-doctor.txt index 730eb30b..dd603898 100644 --- a/docs/clinic-doctor.txt +++ b/docs/clinic-doctor.txt @@ -38,6 +38,7 @@ -h | --help Display Help -v | --version Display Version --collect-only Do not process data on termination + --collect-delay Specify a delay(ms) before collecting data --visualize-only datapath Build or rebuild visualization from data --sample-interval interval Sample interval in milliseconds --on-port Run a script when the server starts listening on a port. diff --git a/docs/clinic-flame.txt b/docs/clinic-flame.txt index 86955fd8..32594fc3 100644 --- a/docs/clinic-flame.txt +++ b/docs/clinic-flame.txt @@ -40,6 +40,7 @@ -h | --help Display Help -v | --version Display Version --collect-only Do not process data on termination + --collect-delay Specify a delay(ms) before collecting data --visualize-only datapath Build or rebuild visualization from data --on-port Run a script when the server starts listening on a port. --autocannon Run the autocannon benchmarking tool when the server starts listening on a port. diff --git a/package.json b/package.json index dbce8b11..e618817c 100644 --- a/package.json +++ b/package.json @@ -10,17 +10,17 @@ "clinic": "./bin.js" }, "scripts": { - "test": "standard | snazzy && tap -j1 --timeout 0 --no-cov test/*.test.js", - "test-local": "standard | snazzy && tap -j1 --timeout 0 --no-cov test/*.test.js test-local/*.test.js", + "test": "standard | snazzy && tap -j4 --timeout 0 --no-cov test/*.test.js", + "test-local": "standard | snazzy && tap -j4 --timeout 0 --no-cov test/*.test.js test-local/*.test.js", "ci-lint": "standard | snazzy", - "ci-test-no-cov": "tap -j1 --timeout 0 --no-cov test/*.test.js", - "ci-test-cov": "tap -j1 --timeout 0 test/*.test.js", + "ci-test-no-cov": "tap -j4 --timeout 0 --no-cov test/*.test.js", + "ci-test-cov": "tap -j4 --timeout 0 test/*.test.js", "lint": "standard --fix | snazzy" }, "dependencies": { "@nearform/bubbleprof": "^3.0.0", - "@nearform/doctor": "^4.1.0", - "@nearform/flame": "^5.0.0", + "@nearform/doctor": "nearform/node-clinic-doctor#collect_timeout_feature", + "@nearform/flame": "nearform/node-clinic-flame#collect_timeout_feature", "any-shell-escape": "^0.1.1", "async": "^3.0.1", "autocannon": "^4.0.0",