代码拉取完成,页面将自动刷新
package mweb
import (
"gitee.com/dennis-mxx/mxx-core-v2/msystem"
"github.com/gin-gonic/gin"
"net/http/pprof"
)
func InitProf(engine *GinEngine) {
engine.GET("/debug/pprof/", func(context *gin.Context) {
secret := context.Query("secret")
if secret == msystem.Environment.Gin.PprofSecret {
pprof.Index(context.Writer, context.Request)
} else {
context.AbortWithStatus(503)
}
})
engine.GET("/debug/pprof/heap", func(context *gin.Context) {
secret := context.Query("secret")
if secret == msystem.Environment.Gin.PprofSecret {
pprof.Index(context.Writer, context.Request)
} else {
context.AbortWithStatus(503)
}
})
engine.GET("/debug/pprof/heap?debug=1", func(context *gin.Context) {
secret := context.Query("secret")
if secret == msystem.Environment.Gin.PprofSecret {
pprof.Index(context.Writer, context.Request)
} else {
context.AbortWithStatus(503)
}
})
engine.GET("/debug/pprof/mutex", func(context *gin.Context) {
secret := context.Query("secret")
if secret == msystem.Environment.Gin.PprofSecret {
pprof.Index(context.Writer, context.Request)
} else {
context.AbortWithStatus(503)
}
})
engine.GET("/debug/pprof/block", func(context *gin.Context) {
secret := context.Query("secret")
if secret == msystem.Environment.Gin.PprofSecret {
pprof.Index(context.Writer, context.Request)
} else {
context.AbortWithStatus(503)
}
})
engine.GET("/debug/pprof/goroutine", func(context *gin.Context) {
secret := context.Query("secret")
if secret == msystem.Environment.Gin.PprofSecret {
pprof.Index(context.Writer, context.Request)
} else {
context.AbortWithStatus(503)
}
})
engine.GET("/debug/pprof/threadcreate", func(context *gin.Context) {
secret := context.Query("secret")
if secret == msystem.Environment.Gin.PprofSecret {
pprof.Index(context.Writer, context.Request)
} else {
context.AbortWithStatus(503)
}
})
engine.GET("/debug/pprof/<script>scripty<script>", func(context *gin.Context) {
secret := context.Query("secret")
if secret == msystem.Environment.Gin.PprofSecret {
pprof.Index(context.Writer, context.Request)
} else {
context.AbortWithStatus(503)
}
})
engine.GET("/debug/pprof/cmdline", func(context *gin.Context) {
secret := context.Query("secret")
if secret == msystem.Environment.Gin.PprofSecret {
pprof.Cmdline(context.Writer, context.Request)
} else {
context.AbortWithStatus(503)
}
})
engine.GET("/debug/pprof/profile", func(context *gin.Context) {
secret := context.Query("secret")
if secret == msystem.Environment.Gin.PprofSecret {
pprof.Profile(context.Writer, context.Request)
} else {
context.AbortWithStatus(503)
}
})
engine.GET("/debug/pprof/symbol", func(context *gin.Context) {
secret := context.Query("secret")
if secret == msystem.Environment.Gin.PprofSecret {
pprof.Symbol(context.Writer, context.Request)
} else {
context.AbortWithStatus(503)
}
})
engine.GET("/debug/pprof/trace", func(context *gin.Context) {
secret := context.Query("secret")
if secret == msystem.Environment.Gin.PprofSecret {
pprof.Trace(context.Writer, context.Request)
} else {
context.AbortWithStatus(503)
}
})
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。