feat: pprof

This commit is contained in:
thinkAfCod 2024-11-04 17:54:04 +08:00 committed by Chen Kai
parent 685123294b
commit 77e6dc181c

View file

@ -5,6 +5,7 @@ import (
"database/sql"
"encoding/hex"
"fmt"
"github.com/ethereum/go-ethereum/internal/debug"
"net"
"net/http"
"os/signal"
@ -105,7 +106,7 @@ var (
func init() {
app.Action = shisui
app.Flags = slices.Concat(portalProtocolFlags, historyRpcFlags, metricsFlags)
app.Flags = slices.Concat(portalProtocolFlags, historyRpcFlags, metricsFlags, debug.Flags)
flags.AutoEnvVars(app.Flags, "SHISUI")
}
@ -121,6 +122,9 @@ func shisui(ctx *cli.Context) error {
if err != nil {
return err
}
go func() {
debug.Setup(ctx)
}()
// Start metrics export if enabled
utils.SetupMetrics(ctx)