node-clinic/docs/clinic-bubbleprof.txt
Dan Levy 3d437312c8 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
2019-11-30 13:22:33 +01:00

46 lines
2.1 KiB
Plaintext

<title>Clinic.js BubbleProf</title> - v{{version}}
<code>clinic bubbleprof</code> helps you find asynchronous bottlenecks and debug event loop blocking.
To run <code>clinic bubbleprof</code>
<code>clinic bubbleprof -- 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 bubbleprof --open=false -- node server.js</code>
If profiling on a server, it can be useful to only do data collection:
<code>clinic bubbleprof --collect-only -- node server.js</code>
You can then transfer the data and visualize it locally:
<code>clinic bubbleprof --visualize-only PID.clinic-bubbleprof-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
--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>).