mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-22 16:00:38 +00:00
* chore: print source error in mem-prof * feat(common-pprof): add pprof crate * feat(servers): Add pprof handler to router refactor the mem_prof handler to avoid checking feature while registering router * feat(servers): pprof handler support different output type * docs(common-pprof): Add readme * feat(common-pprof): Build guard using code in pprof-rs's example * feat(common-pprof): use prost * feat: don't add timeout to perf api * feat: add feature pprof * feat: update readme * test: fix tests * feat: close region in TestBase * feat(pprof): addres comments
732 B
732 B
Profiling CPU
Build GreptimeDB with pprof feature
cargo build --features=pprof
HTTP API
Sample at 99 Hertz, for 5 seconds, output report in protobuf format.
curl -s '0:4000/v1/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/v1/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/v1/prof/cpu?seconds=10&frequency=49&output=text' > /tmp/pprof.txt