mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16:44 +00:00
nil
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
d18eddad72
commit
fd2dd39f70
2 changed files with 22 additions and 18 deletions
|
|
@ -390,15 +390,17 @@ func (t *Tree) Cap(root common.Hash, layers int) error {
|
|||
}
|
||||
|
||||
// Update the cache stats
|
||||
var stats fastcache.Stats
|
||||
diff.origin.cache.UpdateStats(&stats)
|
||||
snapshotCacheGetGauge.Update(int64(stats.GetCalls))
|
||||
snapshotCacheSetGauge.Update(int64(stats.SetCalls))
|
||||
snapshotCacheMissGauge.Update(int64(stats.Misses))
|
||||
snapshotCacheSizeGauge.Update(int64(stats.BytesSize))
|
||||
snapshotCacheCapacityGauge.Update(int64(stats.MaxBytesSize))
|
||||
snapshotCacheEntriesGauge.Update(int64(stats.EntriesCount))
|
||||
snapshotCacheCollisionGauge.Update(int64(stats.Collisions))
|
||||
if diff.origin != nil && diff.origin.cache != nil {
|
||||
var stats fastcache.Stats
|
||||
diff.origin.cache.UpdateStats(&stats)
|
||||
snapshotCacheGetGauge.Update(int64(stats.GetCalls))
|
||||
snapshotCacheSetGauge.Update(int64(stats.SetCalls))
|
||||
snapshotCacheMissGauge.Update(int64(stats.Misses))
|
||||
snapshotCacheSizeGauge.Update(int64(stats.BytesSize))
|
||||
snapshotCacheCapacityGauge.Update(int64(stats.MaxBytesSize))
|
||||
snapshotCacheEntriesGauge.Update(int64(stats.EntriesCount))
|
||||
snapshotCacheCollisionGauge.Update(int64(stats.Collisions))
|
||||
}
|
||||
|
||||
// If the generator is still running, use a more aggressive cap
|
||||
diff.origin.lock.RLock()
|
||||
|
|
|
|||
|
|
@ -306,15 +306,17 @@ func (dl *diskLayer) update(root common.Hash, id uint64, block uint64, nodes *no
|
|||
// and returns a newly constructed disk layer. Note the current disk
|
||||
// layer must be tagged as stale first to prevent re-access.
|
||||
func (dl *diskLayer) commit(bottom *diffLayer, force bool) (*diskLayer, error) {
|
||||
var stats fastcache.Stats
|
||||
dl.nodes.UpdateStats(&stats)
|
||||
snapshotCacheGetGauge.Update(int64(stats.GetCalls))
|
||||
snapshotCacheSetGauge.Update(int64(stats.SetCalls))
|
||||
snapshotCacheMissGauge.Update(int64(stats.Misses))
|
||||
snapshotCacheSizeGauge.Update(int64(stats.BytesSize))
|
||||
snapshotCacheCapacityGauge.Update(int64(stats.MaxBytesSize))
|
||||
snapshotCacheEntriesGauge.Update(int64(stats.EntriesCount))
|
||||
snapshotCacheCollisionGauge.Update(int64(stats.Collisions))
|
||||
if dl.nodes != nil {
|
||||
var stats fastcache.Stats
|
||||
dl.nodes.UpdateStats(&stats)
|
||||
snapshotCacheGetGauge.Update(int64(stats.GetCalls))
|
||||
snapshotCacheSetGauge.Update(int64(stats.SetCalls))
|
||||
snapshotCacheMissGauge.Update(int64(stats.Misses))
|
||||
snapshotCacheSizeGauge.Update(int64(stats.BytesSize))
|
||||
snapshotCacheCapacityGauge.Update(int64(stats.MaxBytesSize))
|
||||
snapshotCacheEntriesGauge.Update(int64(stats.EntriesCount))
|
||||
snapshotCacheCollisionGauge.Update(int64(stats.Collisions))
|
||||
}
|
||||
|
||||
dl.lock.Lock()
|
||||
defer dl.lock.Unlock()
|
||||
|
|
|
|||
Loading…
Reference in a new issue