File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,6 +52,10 @@ func runProfile(dataDir string, args []string) error {
5252 if * server != "" {
5353 pprofServer := profile .StartPProfServer (* server )
5454 fmt .Printf ("pprof server started on %s\n " , * server )
55+ fmt .Printf (" CPU profile: curl http://%s/debug/pprof/profile\n " , * server )
56+ fmt .Printf (" Heap: curl http://%s/debug/pprof/heap\n " , * server )
57+ fmt .Printf (" Goroutines: curl http://%s/debug/pprof/goroutine\n " , * server )
58+ fmt .Printf (" Allocs: curl http://%s/debug/pprof/allocs\n " , * server )
5559 fmt .Println ("Press Ctrl+C to stop..." )
5660
5761 // Wait for interrupt
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ package profile
44import (
55 "fmt"
66 "io"
7+ "log"
78 "net/http"
89 _ "net/http/pprof"
910 "os"
@@ -138,13 +139,8 @@ func StartPProfServer(addr string) *http.Server {
138139 }
139140
140141 go func () {
141- fmt .Printf ("Starting pprof server on %s\n " , addr )
142- fmt .Printf (" CPU profile: curl http://%s/debug/pprof/profile\n " , addr )
143- fmt .Printf (" Heap: curl http://%s/debug/pprof/heap\n " , addr )
144- fmt .Printf (" Goroutines: curl http://%s/debug/pprof/goroutine\n " , addr )
145- fmt .Printf (" Allocs: curl http://%s/debug/pprof/allocs\n " , addr )
146142 if err := server .ListenAndServe (); err != nil && err != http .ErrServerClosed {
147- fmt .Printf ("pprof server error: %v\n " , err )
143+ log .Printf ("pprof server error: %v" , err )
148144 }
149145 }()
150146
You can’t perform that action at this time.
0 commit comments