Go pprof性能监控

Go net/http/pprof包提供了一个在WEB项目中使用的性能监控的工具,

使用时只需要引用包:

_"net/http/pprof"

然后就可以在浏览器中访问地址:

http://localhost:port/debug/pprof/来查看性能信息。

最简单的示例:

package main

import (
    "net/http"
    _ "net/http/pprof"
)

func main() {
    http.ListenAndServe("localhost:12060", nil)
}

 

 

然后浏览器访问 :

http://localhost:12060/debug/pprof/

posted @ 2015-06-01 21:45  klain  阅读(714)  评论(0编辑  收藏  举报