mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-05 18:42:19 +00:00
add codeEvict list metric
This commit is contained in:
parent
a745f2391c
commit
f066f52b04
@ -88,6 +88,7 @@ type Coherent struct {
|
|||||||
hits, miss, timeout *metrics.Counter
|
hits, miss, timeout *metrics.Counter
|
||||||
keys, evict *metrics.Counter
|
keys, evict *metrics.Counter
|
||||||
codeHits, codeMiss, codeKeys *metrics.Counter
|
codeHits, codeMiss, codeKeys *metrics.Counter
|
||||||
|
codeEvictLen *metrics.Counter
|
||||||
latestStateView *CoherentRoot
|
latestStateView *CoherentRoot
|
||||||
roots map[ViewID]*CoherentRoot
|
roots map[ViewID]*CoherentRoot
|
||||||
stateEvict, codeEvict *ThreadSafeEvictionList
|
stateEvict, codeEvict *ThreadSafeEvictionList
|
||||||
@ -149,19 +150,20 @@ func New(cfg CoherentConfig) *Coherent {
|
|||||||
panic("empty config passed")
|
panic("empty config passed")
|
||||||
}
|
}
|
||||||
return &Coherent{
|
return &Coherent{
|
||||||
roots: map[ViewID]*CoherentRoot{},
|
roots: map[ViewID]*CoherentRoot{},
|
||||||
stateEvict: &ThreadSafeEvictionList{l: NewList()},
|
stateEvict: &ThreadSafeEvictionList{l: NewList()},
|
||||||
codeEvict: &ThreadSafeEvictionList{l: NewList()},
|
codeEvict: &ThreadSafeEvictionList{l: NewList()},
|
||||||
hasher: sha3.NewLegacyKeccak256(),
|
hasher: sha3.NewLegacyKeccak256(),
|
||||||
cfg: cfg,
|
cfg: cfg,
|
||||||
miss: metrics.GetOrCreateCounter(fmt.Sprintf(`cache_total{result="miss",name="%s"}`, cfg.MetricsLabel)),
|
miss: metrics.GetOrCreateCounter(fmt.Sprintf(`cache_total{result="miss",name="%s"}`, cfg.MetricsLabel)),
|
||||||
hits: metrics.GetOrCreateCounter(fmt.Sprintf(`cache_total{result="hit",name="%s"}`, cfg.MetricsLabel)),
|
hits: metrics.GetOrCreateCounter(fmt.Sprintf(`cache_total{result="hit",name="%s"}`, cfg.MetricsLabel)),
|
||||||
timeout: metrics.GetOrCreateCounter(fmt.Sprintf(`cache_timeout_total{name="%s"}`, cfg.MetricsLabel)),
|
timeout: metrics.GetOrCreateCounter(fmt.Sprintf(`cache_timeout_total{name="%s"}`, cfg.MetricsLabel)),
|
||||||
keys: metrics.GetOrCreateCounter(fmt.Sprintf(`cache_keys_total{name="%s"}`, cfg.MetricsLabel)),
|
keys: metrics.GetOrCreateCounter(fmt.Sprintf(`cache_keys_total{name="%s"}`, cfg.MetricsLabel)),
|
||||||
evict: metrics.GetOrCreateCounter(fmt.Sprintf(`cache_list_total{name="%s"}`, cfg.MetricsLabel)),
|
evict: metrics.GetOrCreateCounter(fmt.Sprintf(`cache_list_total{name="%s"}`, cfg.MetricsLabel)),
|
||||||
codeMiss: metrics.GetOrCreateCounter(fmt.Sprintf(`cache_code_total{result="miss",name="%s"}`, cfg.MetricsLabel)),
|
codeMiss: metrics.GetOrCreateCounter(fmt.Sprintf(`cache_code_total{result="miss",name="%s"}`, cfg.MetricsLabel)),
|
||||||
codeHits: metrics.GetOrCreateCounter(fmt.Sprintf(`cache_code_total{result="hit",name="%s"}`, cfg.MetricsLabel)),
|
codeHits: metrics.GetOrCreateCounter(fmt.Sprintf(`cache_code_total{result="hit",name="%s"}`, cfg.MetricsLabel)),
|
||||||
codeKeys: metrics.GetOrCreateCounter(fmt.Sprintf(`cache_code_keys_total{name="%s"}`, cfg.MetricsLabel)),
|
codeKeys: metrics.GetOrCreateCounter(fmt.Sprintf(`cache_code_keys_total{name="%s"}`, cfg.MetricsLabel)),
|
||||||
|
codeEvictLen: metrics.GetOrCreateCounter(fmt.Sprintf(`cache_code_list_total{name="%s"}`, cfg.MetricsLabel)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,6 +224,7 @@ func (c *Coherent) advanceRoot(viewID ViewID) (r *CoherentRoot) {
|
|||||||
c.keys.Set(uint64(c.latestStateView.cache.Len()))
|
c.keys.Set(uint64(c.latestStateView.cache.Len()))
|
||||||
c.codeKeys.Set(uint64(c.latestStateView.codeCache.Len()))
|
c.codeKeys.Set(uint64(c.latestStateView.codeCache.Len()))
|
||||||
c.evict.Set(uint64(c.stateEvict.Len()))
|
c.evict.Set(uint64(c.stateEvict.Len()))
|
||||||
|
c.codeEvictLen.Set(uint64(c.codeEvict.Len()))
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user