diff --git a/state/metrics.go b/state/metrics.go index 42cdc4c36..f7c1b38a5 100644 --- a/state/metrics.go +++ b/state/metrics.go @@ -4,4 +4,4 @@ import ( "github.com/vechain/thor/v2/metrics" ) -var metricAccountWriteCounter = metrics.LazyLoadCounterVec("account_write_count", []string{"type"}) \ No newline at end of file +var metricAccountCounter = metrics.LazyLoadCounterVec("account_write_count", []string{"type"}) \ No newline at end of file diff --git a/state/state.go b/state/state.go index e2df7c717..a1eca9479 100644 --- a/state/state.go +++ b/state/state.go @@ -519,11 +519,6 @@ func (s *State) Stage(newVer trie.Version) (*Stage, error) { root := trieCpy.Hash() tries = append(tries, trieCpy) - if len(changes) > 0 { - // If gets here, there are addresses with changes and saveAccount was successful - metricAccountWriteCounter().AddWithLabel(int64(len(changes)), map[string]string{"type": "trie"}) - } - return &Stage{ root: root, commit: func() error { @@ -544,7 +539,7 @@ func (s *State) Stage(newVer trie.Version) (*Stage, error) { } } // If gets here, all tries were committed successfully and the last one contains the updated accounts. - metricAccountWriteCounter().AddWithLabel(int64(len(changes)), map[string]string{"type": "state"}) + metricAccountCounter().AddWithLabel(int64(len(changes)), map[string]string{"type": "write"}) return nil }, }, nil