mirror of
https://github.com/clinicjs/node-clinic.git
synced 2026-02-01 17:27:14 +00:00
* Pass timeoutDelay arg to Clinic Doctor * Update -t arg to --on-timeout * Change timeout parameter to collectDelay * Validate usage of the on-port flag * Run linter * Update path for collect_timeout_feature branches * Update arg to match collect-delay in 0x * Add the collect-delay flag * Update docs with collect-delay arg * Add DS_Store to the ignore list * Bubbleprof doesn't have a matching branch
50 lines
2.3 KiB
Plaintext
50 lines
2.3 KiB
Plaintext
|
|
<title>Clinic.js Doctor</title> - v{{version}}
|
|
|
|
<code>clinic doctor</code> is the first step in profiling your application.
|
|
It will show you what kind of problem you are having and recommend the path
|
|
forward.
|
|
|
|
To run <code>clinic doctor</code>
|
|
|
|
<code>clinic doctor -- node server.js</code>
|
|
|
|
Once you exit (Ctrl-C) the process, your report will open in a browser window. You can disable this behavior:
|
|
|
|
<code>clinic doctor --open=false -- node server.js</code>
|
|
|
|
If profiling on a server, it can be useful to only do data collection:
|
|
|
|
<code>clinic doctor --collect-only -- node server.js</code>
|
|
|
|
You can then transfer the data and visualize it locally:
|
|
|
|
<code>clinic doctor --visualize-only PID.clinic-doctor-sample</code>
|
|
|
|
You can use the --autocannon flag to simulate load on your server.
|
|
--autocannon accepts configuration for autocannon using "subarg" syntax:
|
|
|
|
<code>clinic doctor --autocannon [ -m POST /api/example ] -- node server.js</code>
|
|
|
|
When configuring --autocannon, the $PORT environment variable contains the
|
|
port your server is listening on:
|
|
|
|
<code>clinic doctor --autocannon [ -m POST 'http://localhost:$PORT/?\$page=1' ] -- node server.js</code>
|
|
|
|
Note that dollar signs ($) appearing in the URL must be escaped, else they
|
|
will be treated as environment variables as well.
|
|
|
|
<h1>Flags</h1>
|
|
-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.
|
|
--autocannon Run the autocannon benchmarking tool when the server starts listening on a port.
|
|
--open Boolean to enable or disable your report opening in your web browser.
|
|
--dest Destination for the collected data (default <code>.clinic/</code>).
|
|
--upload Upload the visualization using <code>clinic upload</code> instead of saving it locally.
|
|
--server URL Use a different Clinic Upload server than the default (<link>https://upload.clinicjs.org/</link>).
|