Profiling an HTTP server
As you learned in Chapter 11, Code Testing, Optimization, and Profiling, there is a standard Go package named net/http/pprof, which should be used when you want to profile a Go application with its own HTTP server. To that end, importing net/http/pprof will install various handlers under the /debug/pprof/ URL. You will see more on this in a short while. For now, it is enough to remember that the net/http/pprof package should be used to profile web applications with an HTTP server, whereas the runtime/pprof standard Go package should be used to profile all other kinds of applications.
Note that if your profiler works using the http://localhost:8080 address, you will automatically get support for the following web links: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access