debug: add pprof handlers

This commit is contained in:
Mohamed Sohail 2023-03-13 14:30:55 +00:00
parent 8b14445c88
commit 122b16451c
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D
3 changed files with 8 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package main
import (
"github.com/VictoriaMetrics/metrics"
"github.com/labstack/echo/v4"
echopprof "github.com/sevenNt/echo-pprof"
)
func initApiServer() *echo.Echo {
@ -17,5 +18,9 @@ func initApiServer() *echo.Echo {
})
}
if debugFlag {
echopprof.Wrap(server)
}
return server
}

1
go.mod
View File

@ -15,6 +15,7 @@ require (
github.com/knadh/koanf/v2 v2.0.0
github.com/labstack/echo/v4 v4.10.2
github.com/nats-io/nats.go v1.24.0
github.com/sevenNt/echo-pprof v0.1.1-0.20230131020615-4dd36891e14b
github.com/stretchr/testify v1.8.2
github.com/zerodha/logf v0.5.5
)

2
go.sum
View File

@ -555,6 +555,8 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg
github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo=
github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sevenNt/echo-pprof v0.1.1-0.20230131020615-4dd36891e14b h1:IXGKwQZ6+llGbDFyTJvBXWGTkfrAqsbYwtVVm+Ax4WU=
github.com/sevenNt/echo-pprof v0.1.1-0.20230131020615-4dd36891e14b/go.mod h1:ArUb+H7+Tew7UUjK6x2xiAqFrznLrANIfz9M6m66J0c=
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU=
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=