mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-11-04 16:40:21 +00:00
🔨 开启 pprof、优化 agent
This commit is contained in:
1 parent
454a8721ce
commit
a08e3fa1f1
8 files changed
+13
-8
No files matched your search
@@ -7,6 +7,7 @@ import (
|
||||
"time"
|
||||
|
||||
"code.cloudfoundry.org/bytefmt"
|
||||
"github.com/gin-contrib/pprof"
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/naiba/nezha/pkg/mygin"
|
||||
@@ -15,10 +16,11 @@ import (
|
||||
|
||||
func ServeWeb(port uint) {
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
r := gin.Default()
|
||||
if dao.Conf.Debug {
|
||||
gin.SetMode(gin.DebugMode)
|
||||
pprof.Register(r)
|
||||
}
|
||||
r := gin.Default()
|
||||
r.Use(mygin.RecordPath)
|
||||
r.SetFuncMap(template.FuncMap{
|
||||
"tf": func(t time.Time) string {
|
||||
|
||||
Reference in new issue
Block a user