-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Len() method missing from common cache interface #43
Comments
@norri Hi 👋
I thought this meant len(c.Keys()) != c.Len() right? |
The result is the same. I just thought that there is no need to go through all the keys to get the lenght. Nevermind this my comment. |
@norri I commented your PR. |
I still need this. Added new comments to PR. |
It would be useful to have Len() method available in common interface. I would need it for getting metrics for cache usage.
It is available if the cache is created with exact policy
lru.NewCache()
but if you want to use contextcache.NewContext()
then common interface is returned.len(c.Keys())
could be used but it's still not the same.Example:
The text was updated successfully, but these errors were encountered: