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

相關文章
相關標籤/搜索