Browse Source

fix: add mutex and threadcreate traces

Yeuoly 7 months ago
parent
commit
31fd5590ea
2 changed files with 10 additions and 0 deletions
  1. 8 0
      internal/server/controllers/pprof.go
  2. 2 0
      internal/server/http_server.go

+ 8 - 0
internal/server/controllers/pprof.go

@@ -41,3 +41,11 @@ func PprofAllocs(c *gin.Context) {
 func PprofBlock(c *gin.Context) {
 	pprof.Handler("block").ServeHTTP(c.Writer, c.Request)
 }
+
+func PprofMutex(c *gin.Context) {
+	pprof.Handler("mutex").ServeHTTP(c.Writer, c.Request)
+}
+
+func PprofThreadcreate(c *gin.Context) {
+	pprof.Handler("threadcreate").ServeHTTP(c.Writer, c.Request)
+}

+ 2 - 0
internal/server/http_server.go

@@ -152,5 +152,7 @@ func (app *App) pprofGroup(group *gin.RouterGroup, config *app.Config) {
 		group.GET("/heap", controllers.PprofHeap)
 		group.GET("/allocs", controllers.PprofAllocs)
 		group.GET("/block", controllers.PprofBlock)
+		group.GET("/mutex", controllers.PprofMutex)
+		group.GET("/threadcreate", controllers.PprofThreadcreate)
 	}
 }