core: add more

This commit is contained in:
Gary Rong 2025-10-16 11:27:36 +08:00
parent 90badc88a0
commit 0882c4b7ee
2 changed files with 3 additions and 5 deletions

View file

@ -119,6 +119,7 @@ DB commit: %v
Block write: %v Block write: %v
Total: %v Total: %v
%s
%s %s
############################## ##############################
`, block.Number(), block.Hash(), len(block.Transactions()), s.MgasPerSecond, `, block.Number(), block.Hash(), len(block.Transactions()), s.MgasPerSecond,
@ -127,11 +128,8 @@ Total: %v
common.PrettyDuration(s.StorageReads), s.StorageLoaded, common.PrettyDuration(s.StorageReads), s.StorageLoaded,
common.PrettyDuration(s.AccountHashes+s.AccountCommits+s.AccountUpdates+s.StorageCommits+s.StorageUpdates), common.PrettyDuration(s.AccountHashes+s.AccountCommits+s.AccountUpdates+s.StorageCommits+s.StorageUpdates),
common.PrettyDuration(s.TrieDBCommit+s.SnapshotCommit), common.PrettyDuration(s.BlockWrite), common.PrettyDuration(s.TrieDBCommit+s.SnapshotCommit), common.PrettyDuration(s.BlockWrite),
common.PrettyDuration(s.TotalTime), s.StateReadCacheStats) common.PrettyDuration(s.TotalTime), s.StateReadCacheStats, s.StatePrefetchCacheStats)
log.Info("")
for _, line := range strings.Split(msg, "\n") { for _, line := range strings.Split(msg, "\n") {
log.Info(line) log.Info(line)
} }
log.Info("")
} }

View file

@ -120,7 +120,7 @@ func (s ReaderStats) String() string {
if s.StorageDiskHit > 0 { if s.StorageDiskHit > 0 {
storageDiskHitRate = float64(s.StorageDiskHit) / float64(s.StorageDiskHit+s.StorageDiskMiss) * 100 storageDiskHitRate = float64(s.StorageDiskHit) / float64(s.StorageDiskHit+s.StorageDiskMiss) * 100
} }
msg := fmt.Sprintf("=== Reader statistics ===\n") msg := fmt.Sprintf("Reader statistics\n")
msg += fmt.Sprintf("account: cache (hit: %d, miss: %d, rate: %.2f)\n", s.AccountCacheHit, s.AccountCacheMiss, accountCacheHitRate) msg += fmt.Sprintf("account: cache (hit: %d, miss: %d, rate: %.2f)\n", s.AccountCacheHit, s.AccountCacheMiss, accountCacheHitRate)
msg += fmt.Sprintf("account: disk (hit: %d, miss: %d, rate: %.2f)\n", s.AccountDiskHit, s.AccountDiskMiss, accountDiskHitRate) msg += fmt.Sprintf("account: disk (hit: %d, miss: %d, rate: %.2f)\n", s.AccountDiskHit, s.AccountDiskMiss, accountDiskHitRate)
msg += fmt.Sprintf("storage: cache (hit: %d, miss: %d, rate: %.2f)\n", s.StorageCacheHit, s.StorageCacheMiss, storageCacheHitRate) msg += fmt.Sprintf("storage: cache (hit: %d, miss: %d, rate: %.2f)\n", s.StorageCacheHit, s.StorageCacheMiss, storageCacheHitRate)