feat: add profiling recipes
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"mal/internal/config"
|
||||
"mal/internal/observability"
|
||||
"net/http"
|
||||
_ "net/http/pprof" // register pprof handlers on http.DefaultServeMux
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -31,6 +32,8 @@ func ProvideRouter(cfg config.Config, htmlRender render.HTMLRender, metrics *obs
|
||||
r.Static("/static", "./static")
|
||||
r.Static("/dist", "./dist")
|
||||
r.GET("/metrics", gin.WrapH(metrics.Handler()))
|
||||
r.GET("/debug/pprof", gin.WrapH(http.DefaultServeMux))
|
||||
r.GET("/debug/pprof/*action", gin.WrapH(http.DefaultServeMux))
|
||||
r.HTMLRender = htmlRender
|
||||
return r
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user