This commit is contained in:
jiazhizhong
2022-03-10 17:09:03 +08:00
commit 1279635d7f
97 changed files with 10632 additions and 0 deletions

21
jiacrontab_admin/debug.go Normal file
View File

@@ -0,0 +1,21 @@
package admin
import (
"jiacrontab/pkg/base"
"net/http/pprof"
)
func stat(ctx *myctx) {
data := base.Stat.Collect()
ctx.JSON(data)
}
func pprofHandler(ctx *myctx) {
if h := pprof.Handler(ctx.Params().Get("key")); h != nil {
h.ServeHTTP(ctx.ResponseWriter(), ctx.Request())
}
}
func indexDebug(ctx *myctx) {
pprof.Index(ctx.ResponseWriter(), ctx.Request())
}