feat: add `pprof` flag to spiff-workflow

This commit is contained in:
Richard Ramos 2023-05-05 10:00:54 -04:00 committed by Jakub Sokołowski
parent 23138d0dbb
commit 0f0b6f7578
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
1 changed files with 8 additions and 0 deletions

View File

@ -24,6 +24,7 @@ import (
"github.com/status-im/status-go/multiaccounts/accounts"
"github.com/status-im/status-go/multiaccounts/settings"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/profiling"
"github.com/status-im/status-go/protocol"
"github.com/status-im/status-go/protocol/identity/alias"
waku2extn "github.com/status-im/status-go/services/wakuv2ext"
@ -41,6 +42,8 @@ var (
seedPhrase = flag.String("seed-phrase", "", "Seed phrase")
version = flag.Bool("version", false, "Print version and dump configuration")
apiModules = flag.String("api-modules", "wakuext,ext,waku,ens", "API modules to enable in the HTTP server")
pprofEnabled = flag.Bool("pprof", false, "Enable runtime profiling via pprof")
pprofPort = flag.Int("pprof-port", 52525, "Port for runtime profiling via pprof")
dataDir = flag.String("dir", getDefaultDataDir(), "Directory used by node to store data")
networkID = flag.Int(
@ -111,6 +114,11 @@ func main() {
return
}
// Check if profiling shall be enabled.
if *pprofEnabled {
profiling.NewProfiler(*pprofPort).Go()
}
backend := api.NewGethStatusBackend()
err = ImportAccount(*seedPhrase, backend)
if err != nil {