Enhancement
Adds profiling support over API #369
This enhancement adds support for profiling over API via the /debug/pprof
group of endpoints.
Profiling CPU (time taken):
An example of profiling for CPU usage is: /debug/pprof/profile
(will wait for 30s and return a profile), or
You can directly hit go tool pprof -http=":8080" http://localhost:8000/debug/pprof/profile
to get a profile UI (top, graph, flamegraph) for time taken.
Profiling Heap:
An example for profiling for heap usage is: /debug/pprof/heap
(will return a profile for the point in time), or
You can directly hit go tool pprof -http=":8080" http://localhost:8000/debug/pprof/heap
to get a profile UI (top, graph, flamegraph) of heap usage.
See more details for how to profile over here: https://pkg.go.dev/net/http/pprof