プロジェクト
GitHubで見る
DeanThompson/ginpprof
概要
A wrapper for golang web framework gin to use net/http/pprof easily.
Web・アプリ開発計測したスター増加
- 24時間
- 0
- 7日間
- 0
- 15日間
- 0
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナルginpprof
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 ./...
関連プロジェクトを探す
読み込み中…