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
[Pprof]
Enabled = false
Enabled = true
ListenAddr = "127.0.0.1:6060"
[RPCOpt]

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

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

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

Loading…
Cancel
Save