Add logging of memory status
parent
16275601f4
commit
b1e749dab9
|
@ -431,6 +431,8 @@ func storeInternalStateLoop() {
|
|||
lastCompute := time.Now()
|
||||
// randomize the duration between ComputeInternalStateColumnStats to avoid peaks after reboot of machine with multiple blockbooks
|
||||
computePeriod := 9*time.Hour + time.Duration(rand.Float64()*float64((2*time.Hour).Nanoseconds()))
|
||||
lastLogMemory := time.Now()
|
||||
logMemoryPeriod := 15 * time.Minute
|
||||
glog.Info("storeInternalStateLoop starting with db stats recompute period ", computePeriod)
|
||||
tickAndDebounce(storeInternalStatePeriodMs*time.Millisecond, (storeInternalStatePeriodMs-1)*time.Millisecond, chanStoreInternalState, func() {
|
||||
if !computeRunning && lastCompute.Add(computePeriod).Before(time.Now()) {
|
||||
|
@ -447,6 +449,10 @@ func storeInternalStateLoop() {
|
|||
if err := index.StoreInternalState(internalState); err != nil {
|
||||
glog.Error("storeInternalStateLoop ", errors.ErrorStack(err))
|
||||
}
|
||||
if lastLogMemory.Add(logMemoryPeriod).Before(time.Now()) {
|
||||
glog.Info(index.GetMemoryStats())
|
||||
lastLogMemory = time.Now()
|
||||
}
|
||||
})
|
||||
glog.Info("storeInternalStateLoop stopped")
|
||||
}
|
||||
|
|
|
@ -308,7 +308,8 @@ ConnectLoop:
|
|||
}
|
||||
if msTime.Before(time.Now()) {
|
||||
glog.Info(w.db.GetMemoryStats())
|
||||
msTime = time.Now().Add(1 * time.Minute)
|
||||
w.metrics.IndexDBSize.Set(float64(w.db.DatabaseSizeOnDisk()))
|
||||
msTime = time.Now().Add(10 * time.Minute)
|
||||
}
|
||||
h++
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue