Skip to content

Commit

Permalink
Merge pull request #3470 from ElrondNetwork/fix-healthrecord-creation
Browse files Browse the repository at this point in the history
Fix health record creation error
  • Loading branch information
LucianMincu authored Sep 28, 2021
2 parents b11336f + 4ee90b9 commit 54b931d
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions node/nodeRunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,22 @@ func (nr *nodeRunner) shuffleOutStatsAndGC() {
log.Debug("node statistics after running GC", statistics.GetRuntimeStatistics()...)
}

if debugConfig.DoProfileOnShuffleOut {
log.Debug("running profile job")
parentPath := filepath.Join(nr.configs.FlagsConfig.WorkingDir, nr.configs.GeneralConfig.Health.FolderPath)
var stats runtime.MemStats
runtime.ReadMemStats(&stats)
err := health.WriteMemoryUseInfo(stats, time.Now(), parentPath, "softrestart")
log.LogIfError(err)
nr.doProfileOnShuffleOut()
}

func (nr *nodeRunner) doProfileOnShuffleOut() {
debugConfig := nr.configs.GeneralConfig.Debug.ShuffleOut
shouldDoProfile := debugConfig.DoProfileOnShuffleOut && nr.configs.FlagsConfig.UseHealthService
if !shouldDoProfile {
return
}

log.Debug("running profile job")
parentPath := filepath.Join(nr.configs.FlagsConfig.WorkingDir, nr.configs.GeneralConfig.Health.FolderPath)
var stats runtime.MemStats
runtime.ReadMemStats(&stats)
err := health.WriteMemoryUseInfo(stats, time.Now(), parentPath, "softrestart")
log.LogIfError(err)
}

func (nr *nodeRunner) executeOneComponentCreationCycle(
Expand Down

0 comments on commit 54b931d

Please sign in to comment.