Skip to content

Commit

Permalink
node: improve pprof lifecycle (tendermint#9628)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmwaters authored Oct 27, 2022
1 parent 98ad5f1 commit 95bd4b6
Show file tree
Hide file tree
Showing 5 changed files with 817 additions and 775 deletions.
9 changes: 9 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ type RPCConfig struct {
TLSKeyFile string `mapstructure:"tls_key_file"`

// pprof listen address (https://golang.org/pkg/net/http/pprof)
// FIXME: This should be moved under the instrumentation section
PprofListenAddress string `mapstructure:"pprof_laddr"`
}

Expand Down Expand Up @@ -506,6 +507,10 @@ func (cfg *RPCConfig) IsCorsEnabled() bool {
return len(cfg.CORSAllowedOrigins) != 0
}

func (cfg *RPCConfig) IsPprofEnabled() bool {
return len(cfg.PprofListenAddress) != 0
}

func (cfg RPCConfig) KeyFile() string {
path := cfg.TLSKeyFile
if filepath.IsAbs(path) {
Expand Down Expand Up @@ -1201,6 +1206,10 @@ func (cfg *InstrumentationConfig) ValidateBasic() error {
return nil
}

func (cfg *InstrumentationConfig) IsPrometheusEnabled() bool {
return cfg.Prometheus && cfg.PrometheusListenAddr != ""
}

//-----------------------------------------------------------------------------
// Utils

Expand Down
35 changes: 0 additions & 35 deletions node/id.go

This file was deleted.

Loading

0 comments on commit 95bd4b6

Please sign in to comment.