Skip to content
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

merkledb metric naming nits #2844

Merged
merged 1 commit into from
Mar 12, 2024
Merged
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
28 changes: 14 additions & 14 deletions x/merkledb/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type mockMetrics struct {
valueNodeCacheMiss int64
intermediateNodeCacheHit int64
intermediateNodeCacheMiss int64
viewNodeCacheHit int64
viewChangesNodeHit int64
viewChangesNodeMiss int64
viewChangesValueHit int64
viewChangesValueMiss int64
Expand Down Expand Up @@ -70,7 +70,7 @@ func (m *mockMetrics) ViewChangesNodeHit() {
m.lock.Lock()
defer m.lock.Unlock()

m.viewNodeCacheHit++
m.viewChangesNodeHit++
}

func (m *mockMetrics) ViewChangesValueHit() {
Expand Down Expand Up @@ -131,9 +131,9 @@ type metrics struct {
valueNodeCacheHit prometheus.Counter
valueNodeCacheMiss prometheus.Counter
viewChangesNodeHit prometheus.Counter
viewNodeCacheMiss prometheus.Counter
viewValueCacheHit prometheus.Counter
viewValueCacheMiss prometheus.Counter
viewChangesNodeMiss prometheus.Counter
viewChangesValueHit prometheus.Counter
viewChangesValueMiss prometheus.Counter
}

func newMetrics(namespace string, reg prometheus.Registerer) (merkleMetrics, error) {
Expand Down Expand Up @@ -182,17 +182,17 @@ func newMetrics(namespace string, reg prometheus.Registerer) (merkleMetrics, err
Name: "view_changes_node_hit",
Help: "cumulative amount of hits looking up a node in a view's change set",
}),
viewNodeCacheMiss: prometheus.NewCounter(prometheus.CounterOpts{
viewChangesNodeMiss: prometheus.NewCounter(prometheus.CounterOpts{
Namespace: namespace,
Name: "view_changes_node_miss",
Help: "cumulative amount of misses looking up a node in a view's change set",
}),
viewValueCacheHit: prometheus.NewCounter(prometheus.CounterOpts{
viewChangesValueHit: prometheus.NewCounter(prometheus.CounterOpts{
Namespace: namespace,
Name: "view_changes_value_hit",
Help: "cumulative amount of hits looking up a value in a view's change set",
}),
viewValueCacheMiss: prometheus.NewCounter(prometheus.CounterOpts{
viewChangesValueMiss: prometheus.NewCounter(prometheus.CounterOpts{
Namespace: namespace,
Name: "view_changes_value_miss",
Help: "cumulative amount of misses looking up a value in a view's change set",
Expand All @@ -207,9 +207,9 @@ func newMetrics(namespace string, reg prometheus.Registerer) (merkleMetrics, err
reg.Register(m.intermediateNodeCacheHit),
reg.Register(m.intermediateNodeCacheMiss),
reg.Register(m.viewChangesNodeHit),
reg.Register(m.viewNodeCacheMiss),
reg.Register(m.viewValueCacheHit),
reg.Register(m.viewValueCacheMiss),
reg.Register(m.viewChangesNodeMiss),
reg.Register(m.viewChangesValueHit),
reg.Register(m.viewChangesValueMiss),
)
return &m, err
}
Expand All @@ -231,15 +231,15 @@ func (m *metrics) ViewChangesNodeHit() {
}

func (m *metrics) ViewChangesNodeMiss() {
m.viewNodeCacheMiss.Inc()
m.viewChangesNodeMiss.Inc()
}

func (m *metrics) ViewChangesValueHit() {
m.viewValueCacheHit.Inc()
m.viewChangesValueHit.Inc()
}

func (m *metrics) ViewChangesValueMiss() {
m.viewValueCacheMiss.Inc()
m.viewChangesValueMiss.Inc()
}

func (m *metrics) IntermediateNodeCacheHit() {
Expand Down
Loading