Skip to content

Commit dad2eae

Browse files
committed
增加性能监控
1 parent cbd442c commit dad2eae

6 files changed

Lines changed: 161 additions & 1 deletion

File tree

main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/itcloudy/base-framework/common"
1010
"github.com/itcloudy/base-framework/router"
1111
"github.com/itcloudy/base-framework/system"
12+
_ "net/http/pprof"
1213
"os"
1314
"path"
1415
)

router/router.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
package router
55

66
import (
7+
"github.com/gin-contrib/pprof"
78
"github.com/gin-gonic/gin"
89
)
910

1011
//InitRouter router init
1112
func InitRouter() *gin.Engine {
1213

1314
router := gin.Default()
14-
15+
pprof.Register(router, "dev/pprof")
1516

1617
router.Use(gin.Recovery())
1718
// add routers

vendor/github.com/gin-contrib/pprof/LICENSE

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/gin-contrib/pprof/README.md

Lines changed: 81 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/gin-contrib/pprof/pprof.go

Lines changed: 50 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/vendor.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
"revision": "f664265f5a662fb4d1df7f3533b1e8d0e0277120",
3333
"revisionTime": "2017-12-05T05:05:44Z"
3434
},
35+
{
36+
"checksumSHA1": "npZXclmdhAw1yVGxky0MXPEivgQ=",
37+
"path": "github.com/gin-contrib/pprof",
38+
"revision": "a27513940d36b2d14ba3c3459216b28b807fe8bd",
39+
"revisionTime": "2018-08-27T02:40:24Z"
40+
},
3541
{
3642
"checksumSHA1": "QeKwBtN2df+j+4stw3bQJ6yO4EY=",
3743
"path": "github.com/gin-contrib/sse",

0 commit comments

Comments
 (0)