|
|
|
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.
Patch Set 1 #Patch Set 2 : diff -r 2518eee18c4f https://code.google.com/p/go/ #Patch Set 3 : diff -r 2518eee18c4f https://code.google.com/p/go/ #
Total comments: 1
Patch Set 4 : diff -r 80be10893a8b https://code.google.com/p/go/ #
Total comments: 1
Patch Set 5 : diff -r bb2316abeea5 https://code.google.com/p/go/ #Total messages: 13
|
patrickxb
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
|
13 years, 4 months ago (2012年08月23日 18:49:00 UTC) #1 |
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
this change looks good, have you signed the CLA as described in http://tip.golang.org/doc/contribute.html#copyright
Just signed it. Thanks. On Fri, Aug 24, 2012 at 4:50 AM, <minux.ma@gmail.com> wrote: > this change looks good, have you signed the CLA as > described in http://tip.golang.org/doc/contribute.html#copyright > > http://codereview.appspot.com/6483049/ -- Founder | www.stathat.com | twitter.com/stat_hat
http://codereview.appspot.com/6483049/diff/2001/src/pkg/net/http/pprof/pprof.go File src/pkg/net/http/pprof/pprof.go (right): http://codereview.appspot.com/6483049/diff/2001/src/pkg/net/http/pprof/pprof.... src/pkg/net/http/pprof/pprof.go:18: // need to start one. Import "net/http" and add the following to Add "net/http" to your imports and the following code to your main function: go http.ListenAndServe("localhost:6060", nil) (or, probably better) go func() { log.Println(http.ListenAndServe("localhost:6060", nil)) }()
Hello golang-dev@googlegroups.com, minux.ma@gmail.com, adg@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
a suggestion. i think if we mention "net/http", we also need to mention "log". http://codereview.appspot.com/6483049/diff/8001/src/pkg/net/http/pprof/pprof.go File src/pkg/net/http/pprof/pprof.go (right): http://codereview.appspot.com/6483049/diff/8001/src/pkg/net/http/pprof/pprof.... src/pkg/net/http/pprof/pprof.go:18: // need to start one. Add "net/http" to your imports and the and "log" to your imports...
Hello golang-dev@googlegroups.com, minux.ma@gmail.com, adg@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
LGTM, leave for adg.
Sorry for jumping in the middle of the thread but given that you are fixing the documentation I might as well express my doubts here. If I import _ "net/http/pprof" in my code and do not run the http server will the application waste clock cycles? Can the profiler (http server?) be turned on and off during execution (with a flag or something) and use no cpu when turned off? Could you please document all this? Sorry for the intrusion. Giacomo On Wednesday, 29 August 2012 17:57:43 UTC+2, minux wrote: > > LGTM, leave for adg. > > http://codereview.appspot.com/6483049/ >
Importing "net/http/pprof" won't waste any clock cycles. When you make a request (like "/debug/pprof/profile"), it starts profiling for 30 seconds, then shuts off. I can add information about this to the documentation, but the point of my original documentation addition was just to help people get the example "go tool pprof..." commands working. Patrick On Wed, Aug 29, 2012 at 2:03 PM, <giacomo.tartari@gmail.com> wrote: > Sorry for jumping in the middle of the thread but given that you are fixing > the documentation I might as well express my doubts here. > If I import _ "net/http/pprof" in my code and do not run the http server > will the application waste clock cycles? > Can the profiler (http server?) be turned on and off during execution (with > a flag or something) and use no cpu when turned off? > Could you please document all this? > > Sorry for the intrusion. > > Giacomo > > On Wednesday, 29 August 2012 17:57:43 UTC+2, minux wrote: >> >> LGTM, leave for adg. >> >> http://codereview.appspot.com/6483049/ -- Founder | www.stathat.com | twitter.com/stat_hat
Sounds perfect. Thank you and sorry for the intrusion. On Saturday, 1 September 2012 00:25:33 UTC+2, Patrick Crosby wrote: > > Importing "net/http/pprof" won't waste any clock cycles. When you > make a request (like "/debug/pprof/profile"), it starts profiling for > 30 seconds, then shuts off. > > I can add information about this to the documentation, but the point > of my original documentation addition was just to help people get the > example "go tool pprof..." commands working. > > > Patrick > > On Wed, Aug 29, 2012 at 2:03 PM, <giacomo...@gmail.com <javascript:>> > wrote: > > Sorry for jumping in the middle of the thread but given that you are > fixing > > the documentation I might as well express my doubts here. > > If I import _ "net/http/pprof" in my code and do not run the http server > > will the application waste clock cycles? > > Can the profiler (http server?) be turned on and off during execution > (with > > a flag or something) and use no cpu when turned off? > > Could you please document all this? > > > > Sorry for the intrusion. > > > > Giacomo > > > > On Wednesday, 29 August 2012 17:57:43 UTC+2, minux wrote: > >> > >> LGTM, leave for adg. > >> > >> http://codereview.appspot.com/6483049/ > > > > -- > Founder | www.stathat.com | twitter.com/stat_hat >
LGTM Thanks!
*** Submitted as http://code.google.com/p/go/source/detail?r=4965beed4492 *** 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>