opti cache log

pull/4066/head
lutty 3 years ago
parent 616d9a2fb2
commit 1091b8687e
  1. 7
      internal/shardchain/local_cache/local_cache_database.go

@ -2,7 +2,8 @@ package local_cache
import (
"bytes"
"log"
"github.com/harmony-one/harmony/internal/utils"
"go.uber.org/zap"
"time"
"github.com/allegro/bigcache"
@ -45,8 +46,8 @@ func NewLocalCacheDatabase(remoteDB ethdb.KeyValueStore) *LocalCacheDatabase {
}
go func() {
for range time.Tick(time.Second) {
log.Printf("cache: %#v %d (%d)", cache.Stats(), cache.Len(), cache.Capacity())
for range time.Tick(time.Minute) {
utils.GetLogger().Info("local-cache", zap.Any("stats", cache.Stats()), zap.Int("count", cache.Len()), zap.Int("size", cache.Capacity()))
}
}()

Loading…
Cancel
Save