Create a launch configuration like the following. You can have as many launch configurations as you want, each with their own name and set of arguments.
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Check Status",
"program": "${workspaceFolder}/packages/cli/lib/main.js",
"args": ["zosmf", "check", "status"],
"outputCapture": "std"
}
]
}
To debug Jest tests in VS Code, the Jest Runner extension may come in handy.
pprof
requires two components:
- The Node.js package to record profile data, which can be installed with the command
npm install -g pprof
. - The Go CLI to view profile data, which can be installed following the instructions below:
- Install a supported version of the Go development kit (available as the
golang
package fromapt-get
or Chocolatey). - Install Graphviz to render graphs of profile data (available as the
graphviz
package fromapt-get
or Chocolatey). - Install the binary for the
pprof
CLI:go install github.com/google/pprof@latest
Note: If you have an old version of Go, installing the binary may fail. You can skip it and invoke thepprof
CLI packaged with Go instead using the commandgo tool pprof
.
- Install a supported version of the Go development kit (available as the
Set the environment variable NODE_OPTIONS="--require pprof"
to enable the profiler. Then run a Zowe CLI command like npx zowe zosmf check status
.
After the command completes, profile data will be saved to the current directory in pprof-profile-${process.pid}.pb.gz
. To view this data in your browser, open the file with pprof
:
pprof -http=: pprof-profile-${process.pid}.pb.gz
To enable development mode, set the environment variable NODE_ENV=development
when running Zowe CLI.
The following behaviors will change:
- Default log levels for Imperative and Zowe CLI are DEBUG instead of WARN.
- Web help is always generated when
--help-web
is invoked instead of being cached.