Skip to content

pathdb: rename the slots metrics to storages #31905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion triedb/pathdb/difflayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (dl *diffLayer) node(owner common.Hash, path []byte, depth int) ([]byte, co
dirtyNodeHitMeter.Mark(1)
dirtyNodeHitDepthHist.Update(int64(depth))
dirtyNodeReadMeter.Mark(int64(len(n.Blob)))
return n.Blob, n.Hash, &nodeLoc{loc: locDiffLayer, depth: depth}, nil
return n.Blob, n.Hash, &nodeLoc{loc: locDiffCache, depth: depth}, nil
}
// Trie node unknown to this layer, resolve from parent
return dl.parent.node(owner, path, depth+1)
Expand Down
2 changes: 1 addition & 1 deletion triedb/pathdb/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ var (
commitTimeTimer = metrics.NewRegisteredResettingTimer("pathdb/commit/time", nil)
commitNodesMeter = metrics.NewRegisteredMeter("pathdb/commit/nodes", nil)
commitAccountsMeter = metrics.NewRegisteredMeter("pathdb/commit/accounts", nil)
commitStoragesMeter = metrics.NewRegisteredMeter("pathdb/commit/slots", nil)
commitStoragesMeter = metrics.NewRegisteredMeter("pathdb/commit/storages", nil)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's OK to use slots.

commitBytesMeter = metrics.NewRegisteredMeter("pathdb/commit/bytes", nil)

gcTrieNodeMeter = metrics.NewRegisteredMeter("pathdb/gc/node/count", nil)
Expand Down
16 changes: 8 additions & 8 deletions triedb/pathdb/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import (

// The types of locations where the node is found.
const (
locDirtyCache = "dirty" // dirty cache
locCleanCache = "clean" // clean cache
locDiskLayer = "disk" // persistent state
locDiffLayer = "diff" // diff layers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's OK to use the original order. They are some internal variables and won't be exported to outside at all.

locDiffCache = "diff" // in-memory cache for nodes from the diff layer
locDirtyCache = "dirty" // not yet persisted write buffer for modified nodes
locCleanCache = "clean" // fastcache for clean nodes from the disk layer
locDiskLayer = "disk" // on-disk persistent state
)

// nodeLoc is a helpful structure that contains the location where the node
Expand Down Expand Up @@ -67,12 +67,12 @@ func (r *reader) Node(owner common.Hash, path []byte, hash common.Hash) ([]byte,
// Location is always available even if the node
// is not found.
switch loc.loc {
case locCleanCache:
nodeCleanFalseMeter.Mark(1)
case locDiffCache:
nodeDiffFalseMeter.Mark(1)
case locDirtyCache:
nodeDirtyFalseMeter.Mark(1)
case locDiffLayer:
nodeDiffFalseMeter.Mark(1)
case locCleanCache:
nodeCleanFalseMeter.Mark(1)
case locDiskLayer:
nodeDiskFalseMeter.Mark(1)
}
Expand Down