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

Cache hit rate per URL #53

Open
SimenB opened this issue Apr 19, 2017 · 2 comments
Open

Cache hit rate per URL #53

SimenB opened this issue Apr 19, 2017 · 2 comments

Comments

@SimenB
Copy link

SimenB commented Apr 19, 2017

Right now I can get the hitrate per client created, but I'd like to see how the cacherate is per URL as well, kinda like a label in prometheus (which is what we'd use it for). Would that be possible to add?

We query this thing: https://github.com/httpcache4j/httpcache4j/blob/4b26a55286b851ac124c20c8167a78aad860b30b/httpcache4j-core/src/main/java/org/codehaus/httpcache4j/cache/CacheStatistics.java

@hamnis
Copy link
Member

hamnis commented Apr 19, 2017

Sure, but to avoid having a major memory impact is has to be limited somehow.
It should probably be based on a concurrent LRU map and not introduce external dependencies.

PR ?

@hamnis
Copy link
Member

hamnis commented Apr 20, 2017

Another possibility is to add a callback handler that deals with different states of cache.
Then the memory impact is not handled in the library, but by clients.

Use of the callback must be optional, so there must be a Noop handler.

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

No branches or pull requests

2 participants