561 B
561 B
Profiling
To profile any backend code based on backendutil
, follow these steps:
- Rebuild the backend with the
debug
flag:cd $BACKEND_HERE; GOOS=linux go build -tags debug .; cd ..
- Copy the binary to the target machine (if applicable), and stop the API server.
- If you want to profile the CPU utilization, write
cpu
to the file/tmp/hermes.backendlauncher.profilebackends
:echo -n "cpu" > /tmp/hermes.backendlauncher.profilebackends
. Else, replacecpu
withmem
. - Start the API server, with development mode and debug logging enabled.