20 Star 173 Fork 32

qiqi/orange

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
pprof.go 599 Bytes
Copy Edit Raw Blame History
qiqi authored 2020-12-23 10:56 +08:00 . 迁移内部方法,优化路由注册日志
package app
import (
"gitee.com/zhucheer/orange/internal"
"net/http"
"net/http/pprof"
)
type pprofRoute struct {
Path string
HandlerFunc func(w http.ResponseWriter, r *http.Request)
}
var debupApi = []pprofRoute{
{"/debug/pprof/", pprof.Index},
{"/debug/pprof/cmdline", pprof.Cmdline},
{"/debug/pprof/profile", pprof.Profile},
{"/debug/pprof/symbol", pprof.Symbol},
{"/debug/pprof/trace", pprof.Trace},
}
func runPprof(httpSrv *http.ServeMux) {
for _, item := range debupApi {
httpSrv.HandleFunc(item.Path, item.HandlerFunc)
internal.ConsoleRouter("DEBUG", item.Path)
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/zhucheer/orange.git
git@gitee.com:zhucheer/orange.git
zhucheer
orange
orange
v0.5.20

Search