프로젝트
GitHub에서 보기
DeanThompson/ginpprof
소개
A wrapper for golang web framework gin to use net/http/pprof easily.
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalginpprof
A wrapper for gin to mount net/http/pprof routes quickly.
Why this project
ginpprof was created before gin-contrib/pprof, and many existing services still rely on it.
This repository is maintained to keep those users on a stable and lightweight API.
Install
go get github.com/DeanThompson/ginpprof@latest
Usage
package main
import (
"github.com/gin-gonic/gin"
"github.com/DeanThompson/ginpprof"
)
func main() {
router := gin.Default()
router.GET("/ping", func(c *gin.Context) {
c.String(200, "pong")
})
// Mount default pprof routes under /debug/pprof
ginpprof.Wrap(router)
// Or mount via group:
// group := router.Group("/debug/pprof")
// ginpprof.WrapGroup(group)
router.Run(":8080")
}
Registered routes
GET /debug/pprof/GET /debug/pprof/heapGET /debug/pprof/goroutineGET /debug/pprof/allocsGET /debug/pprof/blockGET /debug/pprof/threadcreateGET /debug/pprof/cmdlineGET /debug/pprof/profileGET /debug/pprof/symbolPOST /debug/pprof/symbolGET /debug/pprof/traceGET /debug/pprof/mutex
Security notes
pprof endpoints expose runtime internals. For production:
- protect routes with auth middleware,
- restrict by network/IP,
- or expose only in internal environments.
Development
go test ./...
관련 프로젝트 살펴보기
불러오는 중…