feat: add `pprof` flag to spiff-workflow
This commit is contained in:
parent
23138d0dbb
commit
0f0b6f7578
|
@ -24,6 +24,7 @@ import (
|
||||||
"github.com/status-im/status-go/multiaccounts/accounts"
|
"github.com/status-im/status-go/multiaccounts/accounts"
|
||||||
"github.com/status-im/status-go/multiaccounts/settings"
|
"github.com/status-im/status-go/multiaccounts/settings"
|
||||||
"github.com/status-im/status-go/params"
|
"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"
|
||||||
"github.com/status-im/status-go/protocol/identity/alias"
|
"github.com/status-im/status-go/protocol/identity/alias"
|
||||||
waku2extn "github.com/status-im/status-go/services/wakuv2ext"
|
waku2extn "github.com/status-im/status-go/services/wakuv2ext"
|
||||||
|
@ -41,6 +42,8 @@ var (
|
||||||
seedPhrase = flag.String("seed-phrase", "", "Seed phrase")
|
seedPhrase = flag.String("seed-phrase", "", "Seed phrase")
|
||||||
version = flag.Bool("version", false, "Print version and dump configuration")
|
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")
|
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")
|
dataDir = flag.String("dir", getDefaultDataDir(), "Directory used by node to store data")
|
||||||
networkID = flag.Int(
|
networkID = flag.Int(
|
||||||
|
@ -111,6 +114,11 @@ func main() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if profiling shall be enabled.
|
||||||
|
if *pprofEnabled {
|
||||||
|
profiling.NewProfiler(*pprofPort).Go()
|
||||||
|
}
|
||||||
|
|
||||||
backend := api.NewGethStatusBackend()
|
backend := api.NewGethStatusBackend()
|
||||||
err = ImportAccount(*seedPhrase, backend)
|
err = ImportAccount(*seedPhrase, backend)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue