Alter memory stats logging levels

This commit is contained in:
Martin Boehm 2022-09-01 20:55:54 +02:00 committed by Martin
parent 72f2c6fcb7
commit 60df986fb8
3 changed files with 8 additions and 4 deletions

View File

@ -544,7 +544,7 @@ func (b *EthereumRPC) processEventsForBlock(blockNumber string) (map[string][]*b
"toBlock": blockNumber, "toBlock": blockNumber,
}) })
if err != nil { if err != nil {
return nil, nil, errors.Annotatef(err, "blockNumber %v", blockNumber) return nil, nil, errors.Annotatef(err, "eth_getLogs blockNumber %v", blockNumber)
} }
r := make(map[string][]*bchain.RpcLog) r := make(map[string][]*bchain.RpcLog)
for i := range logs { for i := range logs {
@ -708,7 +708,7 @@ func (b *EthereumRPC) GetBlock(hash string, height uint32) (*bchain.Block, error
blockSpecificData = &bchain.EthereumBlockSpecificData{} blockSpecificData = &bchain.EthereumBlockSpecificData{}
if err != nil { if err != nil {
blockSpecificData.InternalDataError = err.Error() blockSpecificData.InternalDataError = err.Error()
glog.Info("InternalDataError ", bbh.Height, ": ", err.Error()) // glog.Info("InternalDataError ", bbh.Height, ": ", err.Error())
} }
if len(ens) > 0 { if len(ens) > 0 {
blockSpecificData.AddressAliasRecords = ens blockSpecificData.AddressAliasRecords = ens

View File

@ -583,7 +583,9 @@ func storeInternalStateLoop() {
glog.Error("storeInternalStateLoop ", errors.ErrorStack(err)) glog.Error("storeInternalStateLoop ", errors.ErrorStack(err))
} }
if lastAppInfo.Add(logAppInfoPeriod).Before(time.Now()) { if lastAppInfo.Add(logAppInfoPeriod).Before(time.Now()) {
glog.Info(index.GetMemoryStats()) if glog.V(1) {
glog.Info(index.GetMemoryStats())
}
if err := blockbookAppInfoMetric(index, chain, txCache, internalState, metrics); err != nil { if err := blockbookAppInfoMetric(index, chain, txCache, internalState, metrics); err != nil {
glog.Error("blockbookAppInfoMetric ", err) glog.Error("blockbookAppInfoMetric ", err)
} }

View File

@ -386,7 +386,9 @@ ConnectLoop:
start = time.Now() start = time.Now()
} }
if msTime.Before(time.Now()) { if msTime.Before(time.Now()) {
glog.Info(w.db.GetMemoryStats()) if glog.V(1) {
glog.Info(w.db.GetMemoryStats())
}
w.metrics.IndexDBSize.Set(float64(w.db.DatabaseSizeOnDisk())) w.metrics.IndexDBSize.Set(float64(w.db.DatabaseSizeOnDisk()))
msTime = time.Now().Add(10 * time.Minute) msTime = time.Now().Add(10 * time.Minute)
} }