summaryrefslogtreecommitdiff
path: root/src/pkg/net
diff options
context:
space:
mode:
authorPatrick Crosby <patrick@stathat.com>2012-09-04 11:27:20 +1000
committerPatrick Crosby <patrick@stathat.com>2012-09-04 11:27:20 +1000
commit7dadc8671e5ed159bba11f5540475fb2448cf9ef (patch)
tree0548fc9be6ffea6b10abc39a3d37d2cb86883993 /src/pkg/net
parentc912bcb90d5ed78380767469af3c476891209ed7 (diff)
downloadgo-7dadc8671e5ed159bba11f5540475fb2448cf9ef.tar.gz
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 http://codereview.appspot.com/6483049 Committer: Andrew Gerrand <adg@golang.org>
Diffstat (limited to 'src/pkg/net')
-rw-r--r--src/pkg/net/http/pprof/pprof.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/pkg/net/http/pprof/pprof.go b/src/pkg/net/http/pprof/pprof.go
index 06fcde144..7a9f465c4 100644
--- a/src/pkg/net/http/pprof/pprof.go
+++ b/src/pkg/net/http/pprof/pprof.go
@@ -14,6 +14,14 @@
// To use pprof, link this package into your program:
// 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:
//
// go tool pprof http://localhost:6060/debug/pprof/heap