mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 21:00:44 +00:00
feat(gateway): profile watched gateway startup
This commit is contained in:
@@ -246,6 +246,23 @@ Disable auto-attach while keeping tmux management:
|
||||
OPENCLAW_GATEWAY_WATCH_ATTACH=0 pnpm gateway:watch
|
||||
```
|
||||
|
||||
Profile watched Gateway CPU time when debugging startup/runtime hotspots:
|
||||
|
||||
```bash
|
||||
pnpm gateway:watch --benchmark
|
||||
```
|
||||
|
||||
The watch wrapper consumes `--benchmark` before invoking the Gateway and writes
|
||||
one V8 `.cpuprofile` per Gateway child exit under
|
||||
`.artifacts/gateway-watch-profiles/`. Stop or restart the watched gateway to
|
||||
flush the current profile, then open it with Chrome DevTools or Speedscope:
|
||||
|
||||
```bash
|
||||
npx speedscope .artifacts/gateway-watch-profiles/*.cpuprofile
|
||||
```
|
||||
|
||||
Use `--benchmark-dir <path>` when you want profiles somewhere else.
|
||||
|
||||
The tmux wrapper carries common non-secret runtime selectors such as
|
||||
`OPENCLAW_PROFILE`, `OPENCLAW_CONFIG_PATH`, `OPENCLAW_STATE_DIR`,
|
||||
`OPENCLAW_GATEWAY_PORT`, and `OPENCLAW_SKIP_CHANNELS` into the pane. Put
|
||||
|
||||
Reference in New Issue
Block a user