# README
gin_pprof
use
package main
import (
"https://github.com/climber-dong/global/core/pprofx"
"github.com/gin-gonic/gin"
)
func main() {
router := gin.Default()
router.GET("/ping", func(c *gin.Context) {
c.String(200, "pong")
})
// automatically add routers for net/http/pprofx
// e.g. /debug/pprofx, /debug/pprofx/heap, etc.
pprofx.Wrap(router)
// pprofx also plays well with *gin.RouterGroup
// group := router.Group("/debug/pprofx")
// pprofx.WrapGroup(group)
router.Run(":8080")
}
# Functions
AllocsHandler will pass the call from /debug/pprofx/allocs to pprofx.
BlockHandler will pass the call from /debug/pprofx/block to pprofx.
CmdlineHandler will pass the call from /debug/pprofx/cmdline to pprofx.
GoroutineHandler will pass the call from /debug/pprofx/goroutine to pprofx.
HeapHandler will pass the call from /debug/pprofx/heap to pprofx.
IndexHandler will pass the call from /debug/pprofx to pprofx.
MutexHandler will pass the call from /debug/pprofx/mutex to pprofx.
ProfileHandler will pass the call from /debug/pprofx/profile to pprofx.
SymbolHandler will pass the call from /debug/pprofx/symbol to pprofx.
ThreadCreateHandler will pass the call from /debug/pprofx/threadcreate to pprofx.
TraceHandler will pass the call from /debug/pprofx/tracex to pprofx.
Wrap adds several routes from package `net/http/pprofx` to *gin.Engine object.
WrapGroup adds several routes from package `net/http/pprofx` to *gin.RouterGroup object.
# Variables
Wrapper make sure we are backward compatible.