我有一個現有的http服務器,我想要配置它。我已經包含_ "net/http/pprof"
我進口,我已經有HTTP服務器上運行:不能在現有服務器上使用go工具pprof
router := createRouter()
server := &http.Server {
Addr: ":8080",
Handler: router,
ReadTimeout: 15*time.Second,
WriteTimeout: 15*time.Second,
// MaxHeaderBytes: 4096,
}
log.Fatal(server.ListenAndServe())
當我試圖訪問http://localhost:8080/debug/pprof/我得到404 page not found
。
這就是我在本地機器上使用go tool pprof
時得到:
[email protected]:~/Desktop/gotest$ go tool pprof http://192.168.0.27:8080/
Use of uninitialized value $prefix in concatenation (.) or string at /usr/lib/go/pkg/tool/linux_amd64/pprof line 3019.
Read http://192.168.0.27:8080/pprof/symbol
Failed to get the number of symbols from http://192.168.0.27:8080/pprof/symbol
[email protected]:~/Desktop/gotest$ go tool pprof http://localhost:8080/debug/pprof/profile
Read http://localhost:8080/debug/pprof/symbol
Failed to get the number of symbols from http://localhost:8080/debug/pprof/symbol
同爲遠程客戶端:
MacBookAir:~ apple$ go tool pprof http://192.168.0.27:8080/
Use of uninitialized value $prefix in concatenation (.) or string at /usr/local/Cellar/go/1.3.2/libexec/pkg/tool/darwin_amd64/pprof line 3027.
Read http://192.168.0.27:8080/pprof/symbol
Failed to get the number of symbols from http://192.168.0.27:8080/pprof/symbol