add pprof view

This commit is contained in:
Jay 2018-10-11 11:19:55 +08:00
parent dadec96cc0
commit bd8971d9a6
2 changed files with 13 additions and 0 deletions

9
Gopkg.lock generated
View File

@ -44,6 +44,14 @@
revision = "cf4846e6a636a76237a28d9286f163c132e841bc" revision = "cf4846e6a636a76237a28d9286f163c132e841bc"
version = "v1.2" version = "v1.2"
[[projects]]
digest = "1:fd66f3d5f4398879b0051e46e8421abdc93b5a6a64b645dc80986157fb99308d"
name = "github.com/gin-contrib/pprof"
packages = ["."]
pruneopts = "UT"
revision = "cea200e02ddddca4b843d75d32aa13c413549de9"
version = "v1.1"
[[projects]] [[projects]]
branch = "master" branch = "master"
digest = "1:36fe9527deed01d2a317617e59304eb2c4ce9f8a24115bcc5c2e37b3aee5bae4" digest = "1:36fe9527deed01d2a317617e59304eb2c4ce9f8a24115bcc5c2e37b3aee5bae4"
@ -251,6 +259,7 @@
input-imports = [ input-imports = [
"github.com/PuerkitoBio/goquery", "github.com/PuerkitoBio/goquery",
"github.com/gin-contrib/cors", "github.com/gin-contrib/cors",
"github.com/gin-contrib/pprof",
"github.com/gin-gonic/contrib/sessions", "github.com/gin-gonic/contrib/sessions",
"github.com/gin-gonic/gin", "github.com/gin-gonic/gin",
"github.com/gin-gonic/gin/binding", "github.com/gin-gonic/gin/binding",

View File

@ -13,6 +13,7 @@ import (
"git.trj.tw/golang/mtfosbot/router/rimg" "git.trj.tw/golang/mtfosbot/router/rimg"
"git.trj.tw/golang/mtfosbot/router/twitch" "git.trj.tw/golang/mtfosbot/router/twitch"
"github.com/gin-contrib/cors" "github.com/gin-contrib/cors"
"github.com/gin-contrib/pprof"
"github.com/gin-gonic/contrib/sessions" "github.com/gin-gonic/contrib/sessions"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
@ -102,4 +103,7 @@ func SetRoutes(r *gin.Engine) {
twitchApis.GET("/login", context.PatchCtx(twitch.OAuthLogin)) twitchApis.GET("/login", context.PatchCtx(twitch.OAuthLogin))
twitchApis.GET("/oauth", context.PatchCtx(twitch.OAuthProc)) twitchApis.GET("/oauth", context.PatchCtx(twitch.OAuthProc))
} }
// set pprof router
pprof.Register(r)
} }