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 that should be used when you want to profile a Go application with its own HTTP server. Therefore, importing net/http/pprof will install various handlers under the /debug/pprof/ URL. You will see more of this in a short while. For now, it is enough that you remember that the net/http/pprof package should be used for profiling web applications with an HTTP server, whereas the runtime/pprof standard Go package should be used for profiling all other kinds of applications.

Note that if your profiler works using the http://localhost:8080 address, you will get support for the following web links: ...

Get Mastering Go now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.