Go pprof性能监控

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

使用时只须要引用包:工具

_"net/http/pprof"性能

而后就能够在浏览器中访问地址:spa

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

最简单的示例:code

package main

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

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

 

 

而后浏览器访问 :blog

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

相关文章
相关标签/搜索