50 Commits

Author SHA1 Message Date
Rafael Silva
eaa709bb8e
feat: add stop delay arg (#331)
* feat: add stop-delay option

* doc: stop-delay option documentation

* chore: upgrade minimum v12 version

* tests: improve test to stop-delay
2022-02-07 10:16:03 -03:00
Rafael Gonzaga
93ea3711d1
bump v10 (#299)
* update: use clinic scoped packages

* 10.0.0
2021-11-15 08:16:53 -03:00
Rafael Gonzaga
dd04d9be15
bump 9.1.0 (#297)
* 9.1.0

* chore: bump 9.1.0
2021-11-11 14:19:08 -03:00
Rafael Gonzaga
87e8a215dc
chore: add ci support node 16 (#292)
* chore: bump tap version

* chore: add v16 to test matrix

* chore: update coverage settings to latest tap version

* chore: use taprc

* chore: support v17

* chore: updade coverage settings
2021-10-28 09:41:21 -03:00
James M Snell
53a58b5a97
Drop Node.js 10, bump to 9.0.0 (#283) 2021-05-13 16:17:00 -07:00
Shogun
a4ac25cb88
Add heap profiler to the CLI (#273)
Signed-off-by: James M Snell <jasnell@gmail.com>
2021-05-13 13:42:27 -07:00
James M Snell
2783c8b9ef
Update dependencies, bump to 8.0.0 (#269)
Ask/Upload is removed
2020-11-24 16:30:21 -08:00
Salman Mitha
99269cc567
Removed upload/auth functionalities (#263) 2020-11-24 15:47:30 -08:00
Renée Kooi
9f1e90ff09
Tweak node argument check (#230) 2020-04-23 13:18:13 +02:00
DylanC
974ed78a5c
Fix all tests for terminal links (#210)
* Fixed test for bubbleprof full

* Fix for bubbleprof visualize test

* Fix for doctor full test

* Another fix for bubbleprof visualize

* Fix for doctor visualize test

* Fixes for flame full and doctor visualize tests

* Fix for flame visualize test - all tests passing
2020-02-11 12:48:55 +00:00
Renée Kooi
ac8b4a4fbc
Upgrade standard. 2019-10-24 11:59:45 +02:00
Renée Kooi
19131a3fd3
Automatically privately upload profiles using `clinic $tool --up… (#180)
* Promisify command handlers

* Implement --upload

* tweak UI, delete files after upload

* Revert to previous phrasing so i dont have to update a million tests

* lint fix

* add --upload test

* lint fix
2019-10-15 16:47:50 +02:00
Renée Kooi
7d902cb448
Print authentication URL if browser is not available (#178)
* Print URL if open() failed

* Detect SSH sessions (so we dont silently start elinks in the background)

* Fix tests

* Add ssh auth test
2019-10-15 16:47:30 +02:00
Renée Kooi
7958aa21b3
Test backslash-escaping $NOT_ENV_VARS in --autocannon URL (#134)
* Add tests for autocannon CLI passthrough

* Remove console.logs
2019-09-19 13:34:46 +02:00
Renée Kooi
1bba02a828
Switch opn to open (#177)
* Switch `opn` to `open`

`opn` is no longer maintained and moved to the `open` package name.

* Fix lint
2019-07-16 12:09:55 +02:00
Renée Kooi
843a62ac7f
Increase cli-clean-full run time to avoid flakiness, closes #173 (#174)
* Increase cli-clean-full run time to avoid flakiness, closes #173

* more time increases
2019-07-16 11:05:44 +02:00
greenkeeper[bot]
c4e6fcb284 Update standard to the latest version 🚀 (#175)
* chore(package): update standard to version 13.0.1

* standard --fix
2019-07-12 09:48:37 +02:00
greenkeeper[bot]
5e380c55d8 Update tap to the latest version 🚀 (#158)
* chore(package): update tap to version 13.0.0

* tap 13.1

* distinct error message if clinic process exits with signal

* Update expected error messages

* Revert "Update expected error messages"

This reverts commit 781975cad4d02506922598ed21aeab48f375423b.

* Revert "distinct error message if clinic process exits with signal"

This reverts commit 4ee03da4cac246f70a949e5a0aaa1a3a640c7da9.

* fix exit code expectations for clinic doctor

* show dependencies in build output

* tap 14

* Set tap to -j1

* disable coverage on node 8 because 0x doesnt work with it
2019-06-13 15:39:13 +02:00
Renée Kooi
3512b75520
Cleanup temporary profiles after test run (#160)
Helps with disk space on long running machines (eg CITGM ran into space
issues)

And with RAM usage on low end laptops with an in-memory /tmp :)
2019-06-04 13:05:10 +02:00
Renée Kooi
5338b2e68d
Display error message from server if available (#167) 2019-06-04 13:04:46 +02:00
Renée Kooi
16de0011a4
tmp → tempy (#150)
* tmp → tempy

`tmp` adds a SIGINT handler that was causing Clinic to exit prematurely.
`tempy` lets the OS clean up the files.

We're not dealing with massive temporary files, and not with secrets
either, so it's ok for them to stick around for a while.

* Fix test
2019-04-02 16:26:50 +02:00
Renée Kooi
1500beab80
test: allow more time for doctor to take samples (#141) 2019-04-02 13:58:26 +02:00
Adam Davis
51d2cb4ecf
make cli autocannon test run for 2s (#145) 2019-03-28 14:44:23 +00:00
Renée Kooi
f1e2eef0ac
Reduce test output noise (#143)
We have quite a few tests that assert that something went wrong in the
expected way, and each of these would log debugging output. That's fine
on its own but it did make test output eg on CITGM quite confusing,
because many of the things that look like failures are actually not.

These can be added back easily locally of course for debugging :)
2019-03-26 11:57:29 +01:00
Renée Kooi
03c4613113
Set default output directory to $cwd/.clinic (#136)
* Set default output directory to $cwd/.clinic

* Fix tests on windows

* consistent quotes
2019-03-21 16:29:01 +01:00
Stuart Wilson
d8c19ed743 Node Clinic => Clinic.js (#138) 2019-03-21 16:27:40 +01:00
Renée Kooi
0ca696d118
Let users specify custom Ask message on CLI (#126)
* Let users specify custom Ask message on CLI

Opens the $EDITOR in order to add a message.

A temporary file is placed in `profiledir/ASK_MESSAGE`. If the profile
is super broken and didn't output a directory, it uses a temporary file
… somewhere (whatever the `tmp` module decides to do).

* handle empty message

* Expand initial message and fix trailing newlines

* Ask usability updates

- `getAskMessage` gets its own file
- vim starts in insert mode with the cursor at the end of the file
- VS Code forks and returns control to the CLI on start, so we can't
easily wait for it to exit; instead, we wait for user confirmation if
the editor closed within 2 seconds without updating the ASK_MESSAGE file.

* reword to avoid 'no quotes' stuff

Co-Authored-By: goto-bus-stop <renee@kooi.me>
2019-03-06 13:38:06 +01:00
Renée Kooi
3cbe86ec5d
Next (#118)
* clinic ask (#66)

The `ask` command is used to upload on the private area, e.g.: 
```
clinic ask --upload-url=http://localhost:3000 11213.clinic-bubbleprof
```
This will:
- Start the authentication on upload server to obtain a JWT token
- Upload the data to the protected API `/protected/data` on upload server

On the server side, the API can extract the user email from the JWT token to correctly identify the "private" folder for the user

* Authenticate for public uploads and support private uploads without `ask`ing (#102)

`clinic upload xyz.clinic-doctor` now also requires authentication.

A new `clinic upload --private` flag uploads to your private area.

`clinic ask` does `clinic upload --private` and then calls a currently-noop function that can be implemented once we have a `/ask` endpoint on the server.

* Store auth tokens in ~/.node-clinic-rc (#108)

Stores the JWT in ~/.node-clinic-rc after logging in. ~/.node-clinic-rc is a JSON file with upload URLs as keys, JWTs as values.

Use `clinic login` to login manually. Optionally specify an `--upload-url`.
Use `clinic logout` to logout manually. Optionally specify an `--upload-url`. Add `--all` to log out of all Clinic Upload servers, this deletes the ~/.node-clinic-rc file.
Use `clinic user` to show a list of current sessions. Optionally specify an `--upload-url` to only show that session.

You can use the `CLINIC_CREDENTIALS` environment variable to point to a different file. I added this for tests, maybe it's also useful in programmatic environments and warrants docs?

`clinic upload` and `clinic ask` automatically do what `clinic login` does at the start.

* Feature/ask auth flag (#114)

* [666] - Add ask param flag to login URL when authenticating using ask command

* [666] - Factor user terms acceptance into CLI login when validating JWT payload against upload type

* Implement ask with placeholder message (#115)

Means we'll have to reply first to figure out what someone needs help with but it's better than not getting a message at all

* 3.0.0-beta.0@next

* Fix/private public auth redirect (#116)

* Re #99 - Pass flag for private uploads to login URL so app can differentiate intent

* Re #97 - Open new tab on upload callback and create flag to prevent this behaviour if desired

* Re #97 - Update browser open flag to use recommended minimist syntax

* Revert "Disable clinic upload in old CLI. (#117)"

This reverts commit 75f80771b4741a4927788a2d492566d04416e1b7.

* Update tool versions.

* remove weird test? unsure what this was for
2019-02-13 14:34:53 +01:00
Renée Kooi
75f80771b4
Disable clinic upload in old CLI. (#117)
Tell users to update because the Upload Server requires authentication
now.

![image](https://user-images.githubusercontent.com/1006268/52706545-f7705200-2f85-11e9-9235-0105f51261e0.png)
2019-02-13 12:52:08 +01:00
Renée Kooi
70bb8ed828
show ctrl+c and process exit messages, + a spinner during analysis (#98)
improve our CLI messaging a bit by
- immediately showing a message when we receive a Ctrl+C
- showing the "Analysing data" message ASAP when the profiled process exits (requires https://github.com/nearform/node-clinic-bubbleprof/pull/286, https://github.com/nearform/node-clinic-doctor/pull/209, https://github.com/nearform/node-clinic-flame/pull/63)
- showing a loading "spinner" (its a bar really) during the analysis. for fun, its colour is the logo colour of the tool you're running 😛

![ui](https://user-images.githubusercontent.com/1006268/49518814-d8778480-f89f-11e8-942c-ee71f63583d2.gif)

<details><summary>and for bubbleprof</summary>

![ui-bubble](https://user-images.githubusercontent.com/1006268/49519031-5b98da80-f8a0-11e8-80ea-e15c9ffd51c0.gif)

</details>
<details><summary>and for doctor</summary>

![ui-doctor](https://user-images.githubusercontent.com/1006268/49519042-62275200-f8a0-11e8-83ca-85bbcf8fb40a.gif)

</details>
2018-12-05 22:12:43 +01:00
azure-pipelines[bot]
1080fe1a38 Set up CI with Azure Pipelines (#93) 2018-12-03 19:17:42 +01:00
Renée Kooi
c179ffeb45
Add --autocannon flag for tools (#88)
* Add --autocannon flag, shorthand to '--on-port autocannon'

* Mention --autocannon in wrk/autocannon explanation

* fix --autocannon check

* Fix arg list in autocannon test

* wtf is this doing in my commit
2018-11-27 16:49:53 +01:00
Matteo Collina
14302b36ff
Updated dependencies and tests (#87)
* Updated dependencies and tests

* timeout tests at 10s

* disable timeouts

* added some output

* codecov 100% again

* test passing on windows
2018-11-27 16:13:11 +01:00
Renée Kooi
e64653efc9
Strip trailing slash from --visualize-only. (#81)
* Strip trailing slash from --visualize-only.

* add --visualize-only tests for flame

* Use platform path separator in test.

* Support windows path separators.
2018-11-20 12:06:56 +01:00
Renée Kooi
1355b44f1e
Pass through --dest to Flame and Bubbleprof (#76)
* Add --dest to clinic flame.

* Add --dest to clinic bubbleprof.

* Add cli-flame-full test.

* Add --dest tests for each tool.

* Update tools to versions that have --dest.
2018-11-20 11:36:39 +01:00
Renée Kooi
551c824e7a Add CLI metrics and update notifications (#68)
* Track tool use.

* Wait for permission before starting tools.

* Add update-notifier.

* Only ask for metrics permission if we'd actually use it.

Not for basic stuff like --help and --version.

* Disable Insight in tests.

* Avoid swallowing errors in Promise chains.

* Fix Insight optOut override for tests.

* Stub GA tracking code.

* Remove unused errors from callbacks.

* 100% cov

* Configure GA tracking code.
2018-10-25 16:07:17 +02:00
Ruben Bridgewater
66237079cc
Update standard to v.12 and add lint script (#50) 2018-08-29 12:05:02 +02:00
Ruben Bridgewater
be6c77ad4d
Improve description with a note how to generate the output (#44)
* Improve description with a note how to generate the output

This also adds the debug mode to the documentation.
2018-08-27 15:49:37 +02:00
Ruben Bridgewater
0ad51edfc9 check for valid input arguments 2018-08-07 17:52:40 +02:00
Mathias Buus
c02b39923b use updated package names 2018-07-23 23:30:20 +02:00
Mathias Buus
9476443dd0 add cli bubbleprof tests 2018-07-23 20:18:55 +02:00
Mathias Buus
1768d0d4e5 Print upload link (#50)
* print upload link

* disable appveyor cache
2018-07-23 20:03:18 +02:00
Kamil Mech
45a23a6495 Provide upload command after generating sample (#60) 2018-07-23 20:01:10 +02:00
Mathias Buus
6aecda0f70 use @nearform/clinic-flame (#57)
* use @nearform/clinic-flame

* use clinic-flame/version
2018-07-23 19:56:52 +02:00
greenkeeper[bot]
fdd7a1e883 Update dependencies to enable Greenkeeper 🌴 (#12)
* chore(package): update dependencies

* docs(readme): add Greenkeeper badge

* standard 11
2018-04-13 15:29:55 +02:00
Mathias Buus
b05cb75047 Support --on-port in doctor. Fixes #16 (#39)
* support --http in doctor

* @mcollina comments plus more docs

* test this on windows

* fix typo

* refactor to --on-port

* use stable clinic-doctor

* remove extra log
2018-02-27 16:27:44 +01:00
Mathias Buus
2227450876 stricter filtering on the client when using upload (#33) 2018-01-26 17:29:37 +00:00
Mathias Buus
1964d35b01 add clinic clean (#31) 2018-01-25 23:16:09 +01:00
David Mark Clements
2d50599ad7
0x-integration
* 0x-integration

* 0x v3.0.0

* docs

* fixes

* more fixes

* more docs

* --full-help -> --all-options

* add tests

* ignore 0x on ci

* ignore 0x in code coverage

* ignore code coverage

* separate test-local into its own script (needs sudo), and fix test-local requires
2018-01-22 12:53:31 +01:00
Andreas Madsen
a40328e736
prepear for public release 2018-01-19 23:06:16 +01:00