pprof.go 1018 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package controllers
  2. import (
  3. "net/http/pprof"
  4. "github.com/gin-gonic/gin"
  5. )
  6. func PprofIndex(c *gin.Context) {
  7. pprof.Index(c.Writer, c.Request)
  8. }
  9. func PprofCmdline(c *gin.Context) {
  10. pprof.Cmdline(c.Writer, c.Request)
  11. }
  12. func PprofProfile(c *gin.Context) {
  13. pprof.Profile(c.Writer, c.Request)
  14. }
  15. func PprofSymbol(c *gin.Context) {
  16. pprof.Symbol(c.Writer, c.Request)
  17. }
  18. func PprofTrace(c *gin.Context) {
  19. pprof.Trace(c.Writer, c.Request)
  20. }
  21. func PprofGoroutine(c *gin.Context) {
  22. pprof.Handler("goroutine").ServeHTTP(c.Writer, c.Request)
  23. }
  24. func PprofHeap(c *gin.Context) {
  25. pprof.Handler("heap").ServeHTTP(c.Writer, c.Request)
  26. }
  27. func PprofAllocs(c *gin.Context) {
  28. pprof.Handler("allocs").ServeHTTP(c.Writer, c.Request)
  29. }
  30. func PprofBlock(c *gin.Context) {
  31. pprof.Handler("block").ServeHTTP(c.Writer, c.Request)
  32. }
  33. func PprofMutex(c *gin.Context) {
  34. pprof.Handler("mutex").ServeHTTP(c.Writer, c.Request)
  35. }
  36. func PprofThreadcreate(c *gin.Context) {
  37. pprof.Handler("threadcreate").ServeHTTP(c.Writer, c.Request)
  38. }