core: re-organize the stats category

This commit is contained in:
Gary Rong 2026-01-05 15:15:16 +08:00
parent de5ea2ffd8
commit 89fd8ec2a7

View file

@ -115,26 +115,31 @@ func (s *ExecuteStats) logSlow(block *types.Block, slowBlockThreshold time.Durat
Block: %v (%#x) txs: %d, mgasps: %.2f, elapsed: %v Block: %v (%#x) txs: %d, mgasps: %.2f, elapsed: %v
EVM execution: %v EVM execution: %v
Validation: %v Validation: %v
Account hash: %v
Storage hash: %v
State read: %v State read: %v
Account read: %v(%d) Account read: %v(%d)
Storage read: %v(%d) Storage read: %v(%d)
Code read: %v(%d) Code read: %v(%d)
State hash: %v State write: %v
Account hash: %v
Storage hash: %v
Trie commit: %v Trie commit: %v
DB write: %v
State write: %v State write: %v
Block write: %v Block write: %v
%s %s
############################## ##############################
`, block.Number(), block.Hash(), len(block.Transactions()), s.MgasPerSecond, common.PrettyDuration(s.TotalTime), `, block.Number(), block.Hash(), len(block.Transactions()), s.MgasPerSecond, common.PrettyDuration(s.TotalTime),
// EVM execution
common.PrettyDuration(s.Execution), common.PrettyDuration(s.Execution),
common.PrettyDuration(s.Validation+s.CrossValidation),
// Block validation
common.PrettyDuration(s.Validation+s.CrossValidation+s.AccountHashes+s.AccountUpdates+s.StorageUpdates),
common.PrettyDuration(s.AccountHashes+s.AccountUpdates),
common.PrettyDuration(s.StorageUpdates),
// State read // State read
common.PrettyDuration(s.AccountReads+s.StorageReads+s.CodeReads), common.PrettyDuration(s.AccountReads+s.StorageReads+s.CodeReads),
@ -142,19 +147,15 @@ DB write: %v
common.PrettyDuration(s.StorageReads), s.StorageLoaded, common.PrettyDuration(s.StorageReads), s.StorageLoaded,
common.PrettyDuration(s.CodeReads), s.CodeLoaded, common.PrettyDuration(s.CodeReads), s.CodeLoaded,
// State hash // State write
common.PrettyDuration(s.AccountHashes+s.AccountUpdates+s.StorageUpdates+max(s.AccountCommits, s.StorageCommits)), common.PrettyDuration(max(s.AccountCommits, s.StorageCommits)+s.TrieDBCommit+s.SnapshotCommit+s.BlockWrite),
common.PrettyDuration(s.AccountHashes+s.AccountUpdates),
common.PrettyDuration(s.StorageUpdates),
common.PrettyDuration(max(s.AccountCommits, s.StorageCommits)), common.PrettyDuration(max(s.AccountCommits, s.StorageCommits)),
// Database commit
common.PrettyDuration(s.TrieDBCommit+s.SnapshotCommit+s.BlockWrite),
common.PrettyDuration(s.TrieDBCommit+s.SnapshotCommit), common.PrettyDuration(s.TrieDBCommit+s.SnapshotCommit),
common.PrettyDuration(s.BlockWrite), common.PrettyDuration(s.BlockWrite),
// cache statistics // cache statistics
s.StateReadCacheStats) s.StateReadCacheStats,
)
for _, line := range strings.Split(msg, "\n") { for _, line := range strings.Split(msg, "\n") {
if line == "" { if line == "" {
continue continue