20 Star 164 Fork 26

qiqi / orange

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
pprof.go 599 Bytes
一键复制 编辑 原始数据 按行查看 历史
qiqi 提交于 2020-12-23 10:56 . 迁移内部方法,优化路由注册日志
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)
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/zhucheer/orange.git
git@gitee.com:zhucheer/orange.git
zhucheer
orange
orange
v0.5.1

搜索帮助

344bd9b3 5694891 D2dac590 5694891