- v{{version}} clinic flame 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 clinic flame clinic flame -- node server.js Once you exit (Ctrl-C) the process, your report will open in a browser window. You can disable this behavior: clinic flame --open=false -- node server.js If profiling on a server, it can be useful to only do data collection: clinic flame --collect-only -- node server.js You can then transfer the data and visualize it locally: clinic flame --visualize-only PID.clinic.flame You can use the --autocannon flag to simulate load on your server. --autocannon accepts configuration for autocannon using "subarg" syntax: clinic flame --autocannon [ -m POST /api/example ] -- node server.js When configuring --autocannon, the $PORT environment variable contains the port your server is listening on: clinic flame --autocannon [ -m POST 'http://localhost:$PORT/?\$page=1' ] -- node server.js Note that dollar signs ($) appearing in the URL must be escaped, else they will be treated as environment variables as well. You can profile the application using kernel tracing. This will capture native stack frames (C++ modules and Libuv I/O) clinic flame --kernel-tracing -- node server.js

Flags

-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 .clinic/). --kernel-tracing Profile application using linux_perf (linux only). --stop-delay Add a delay to close the process when a job is done through either `autocannon` or `on-port` flag (milliseconds) --name The --name flag sets a name for the output data, allowing you to replace existing reports without generating new ones. Example: .clinic/node-19-test.clinic-flame