Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass collectDelay arg to Clinic Doctor/Flame #208

Merged
merged 11 commits into from
Mar 26, 2020
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,5 @@ typings/
.vscode
# IntelliJ Idea
.idea
# Mac OS
.DS_Store
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 8 additions & 1 deletion bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions docs/clinic-doctor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions docs/clinic-flame.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down