Turn pprof default on with local saved files (#3894)

* Turn pprof default on with local saved files

* [pprof] change interval from 600s to 3600s
pull/4400/head
Jacky Wang 2 years ago committed by GitHub
parent 7d5eb9cd36
commit 78d26d7910
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      cmd/harmony/config_migrations_test.go
  2. 2
      cmd/harmony/config_test.go
  3. 6
      cmd/harmony/default.go
  4. 10
      cmd/harmony/flags_test.go

@ -281,7 +281,7 @@ Version = "1.0.4"
Port = 9000 Port = 9000
[Pprof] [Pprof]
Enabled = false Enabled = true
ListenAddr = "127.0.0.1:6060" ListenAddr = "127.0.0.1:6060"
[RPCOpt] [RPCOpt]

@ -79,7 +79,7 @@ Version = "1.0.4"
Port = 9000 Port = 9000
[Pprof] [Pprof]
Enabled = false Enabled = true
ListenAddr = "127.0.0.1:6060" ListenAddr = "127.0.0.1:6060"
[TxPool] [TxPool]

@ -87,11 +87,11 @@ var defaultConfig = harmonyconfig.HarmonyConfig{
}, },
Sync: getDefaultSyncConfig(defNetworkType), Sync: getDefaultSyncConfig(defNetworkType),
Pprof: harmonyconfig.PprofConfig{ Pprof: harmonyconfig.PprofConfig{
Enabled: false, Enabled: true,
ListenAddr: "127.0.0.1:6060", ListenAddr: "127.0.0.1:6060",
Folder: "./profiles", Folder: "./profiles",
ProfileNames: []string{}, ProfileNames: []string{"cpu", "heap", "goroutine"},
ProfileIntervals: []int{600}, ProfileIntervals: []int{3600},
ProfileDebugValues: []int{0}, ProfileDebugValues: []int{0},
}, },
Log: harmonyconfig.LogConfig{ Log: harmonyconfig.LogConfig{

@ -122,11 +122,11 @@ func TestHarmonyFlags(t *testing.T) {
LocalAccountsFile: "./.hmy/locals.txt", LocalAccountsFile: "./.hmy/locals.txt",
}, },
Pprof: harmonyconfig.PprofConfig{ Pprof: harmonyconfig.PprofConfig{
Enabled: false, Enabled: true,
ListenAddr: "127.0.0.1:6060", ListenAddr: "127.0.0.1:6060",
Folder: "./profiles", Folder: "./profiles",
ProfileNames: []string{}, ProfileNames: []string{"cpu", "heap", "goroutine"},
ProfileIntervals: []int{600}, ProfileIntervals: []int{3600},
ProfileDebugValues: []int{0}, ProfileDebugValues: []int{0},
}, },
Log: harmonyconfig.LogConfig{ Log: harmonyconfig.LogConfig{
@ -1092,9 +1092,9 @@ func TestPprofFlags(t *testing.T) {
expConfig: defaultConfig.Pprof, expConfig: defaultConfig.Pprof,
}, },
{ {
args: []string{"--pprof"}, args: []string{"--pprof=false"},
expConfig: harmonyconfig.PprofConfig{ expConfig: harmonyconfig.PprofConfig{
Enabled: true, Enabled: false,
ListenAddr: defaultConfig.Pprof.ListenAddr, ListenAddr: defaultConfig.Pprof.ListenAddr,
Folder: defaultConfig.Pprof.Folder, Folder: defaultConfig.Pprof.Folder,
ProfileNames: defaultConfig.Pprof.ProfileNames, ProfileNames: defaultConfig.Pprof.ProfileNames,

Loading…
Cancel
Save