Files
greptimedb/docs/how-to/how-to-profile-cpu.md
Yingwen 3b2ce31a19 feat: enable prof features by default (#4815)
* feat: enable prof by default

* docs: don't need to build with features

* feat: add common-pprof as optional dep for pprof feature

* build: remove optional

* feat: use dump_text
2024-10-14 03:32:47 +00:00

657 B

Profiling CPU

HTTP API

Sample at 99 Hertz, for 5 seconds, output report in protobuf format.

curl -s '0:4000/debug/prof/cpu' > /tmp/pprof.out

Then you can use pprof command with the protobuf file.

go tool pprof -top /tmp/pprof.out

Sample at 99 Hertz, for 60 seconds, output report in flamegraph format.

curl -s '0:4000/debug/prof/cpu?seconds=60&output=flamegraph' > /tmp/pprof.svg

Sample at 49 Hertz, for 10 seconds, output report in text format.

curl -s '0:4000/debug/prof/cpu?seconds=10&frequency=49&output=text' > /tmp/pprof.txt