Commit f4c22b29 authored by Patrick Crosby's avatar Patrick Crosby Committed by Andrew Gerrand

net/http/pprof: updated documentation (run an http server)

Added instructions for starting an http server
to the godoc header for this package.  With the old
instructions, the example "go tool pprof..." commands
wouldn't work unless you happen to be running an http
server on port 6060 in your application.

R=golang-dev, minux.ma, adg, giacomo.tartari
CC=golang-dev
https://golang.org/cl/6483049
parent 7f075ece
...@@ -14,6 +14,14 @@ ...@@ -14,6 +14,14 @@
// To use pprof, link this package into your program: // To use pprof, link this package into your program:
// import _ "net/http/pprof" // import _ "net/http/pprof"
// //
// If your application is not already running an http server, you
// need to start one. Add "net/http" and "log" to your imports and
// the following code to your main function:
//
// go func() {
// log.Println(http.ListenAndServe("localhost:6060", nil))
// }()
//
// Then use the pprof tool to look at the heap profile: // Then use the pprof tool to look at the heap profile:
// //
// go tool pprof http://localhost:6060/debug/pprof/heap // go tool pprof http://localhost:6060/debug/pprof/heap
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment