node-clinic/docs/clinic-flame.txt
Dan Levy a0bff20e31
Added undocumented CLI Argument (#200)
* Add missing --open option

* Update clinic-doctor.txt

* Update clinic-flame.txt

* Update clinic-bubbleprof.txt

* Update clinic-flame.txt
2020-03-31 10:15:25 +02:00

50 lines
2.3 KiB
Plaintext

<title>Clinic.js Flame</title> - v{{version}}
<code>clinic flame</code> helps you find synchronous bottlenecks
by creating a flamegraph visualization that assists in identifying
function calls that may be blocking the event loop.
For more information see the 0x readme, https://github.com/davidmarkclements/0x
To run <code>clinic flame</code>
<code>clinic flame -- 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 flame --open=false -- node server.js</code>
If profiling on a server, it can be useful to only do data collection:
<code>clinic flame --collect-only -- node server.js</code>
You can then transfer the data and visualize it locally:
<code>clinic flame --visualize-only PID.clinic.flame</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
--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.
--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>).