Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ After installing the project dependencies, you can run the tool directly:

To run the CLI on a custom port, you can just pass it as an argument with `./cli.js --port 4321`.

To record a flamegraph session, and choose to profile either the `cpu` or the `heap`, you can run the CLI with `./cli.js --record --flamegraph heap`. Once you will stop the process, an HTML one-file bundle will be auto-generated, and you will be able to navigate (even offline) the `watt-admin` app, looking at the flamegraph and at the metrics stored for the whole time you have run the CLI.
To record a flamegraph session, and choose to profile either the `cpu` or the `heap`, you can run the CLI with `./cli.js --record --profile heap`. Once you will stop the process, an HTML one-file bundle will be auto-generated, and you will be able to navigate (even offline) the `watt-admin` app, looking at the flamegraph and at the metrics stored for the whole time you have run the CLI.

The tool is also available as a binary when installed globally or linked:

Expand Down
4 changes: 2 additions & 2 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

'use strict'

import { pathToFileURL } from 'url'
import esmain from 'es-main'
import { RuntimeApiClient } from '@platformatic/control'
import { select } from '@inquirer/prompts'
import { start } from './lib/start.js'
Expand Down Expand Up @@ -137,7 +137,7 @@ export default async function main () {
}

// Execute the main function if this script is run directly
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
if (esmain(import.meta)) {
main().then((selectedRuntime) => {
if (!selectedRuntime) {
return
Expand Down
Loading