Skip to content

common/lru: add metered lru cache variant#33719

Open
cskiraly wants to merge 1 commit intoethereum:masterfrom
cskiraly:metered-lru
Open

common/lru: add metered lru cache variant#33719
cskiraly wants to merge 1 commit intoethereum:masterfrom
cskiraly:metered-lru

Conversation

@cskiraly
Copy link
Copy Markdown
Contributor

This is a drop-in replacement to add metrics to an LRU cache.

This is a drop-in replacement to add metrics to an LRU cache.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
@cskiraly
Copy link
Copy Markdown
Contributor Author

Usage:

-   txLookupCache *lru.Cache[common.Hash, txLookup]
+   txLookupCache *lru.MeteredCache[common.Hash, txLookup]
-   txLookupCache:      lru.NewCache[common.Hash, txLookup](txLookupCacheLimit),
+   txLookupCache:      lru.NewMeteredCache[common.Hash, txLookup](txLookupCacheLimit, "txLookupCache"),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant