-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add cache utilization to basic cache metrics #4321
Comments
What do you mean by cache utilization? Is it |
Yes, |
In order to add something to the |
It might not be exposed ready-to-use, but it can be calculated. For
CacheMeterBinder#bindTo can then create a Gauge
for
|
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
What's still missing? @jonatan-ivanov? |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
What's still missing? @jonatan-ivanov? |
@rschuetz Do you want to propose your changes in a PR? |
I did some research on this one. Caffeine Supported for bounded cache. Possible to implement as suggested above. estimatedSize / maximum jCache Limiting size or getting size is not supported. This is just and API so hard to assume implementation details etc. Guava Not explicitly supported by the API, but it is possible to implement by accessing certain package private classes, fields and methods via reflection to get estimated utilization for cache's segments that support entry weighting. This also requires accessing segment locks via reflection. Quite tricky and heavy reflection use, but I was able to prototype very basic version of this functionality. Not sure if anyone is open for such a heavy solution relying on internal implementation. Ehcache I did some local testing and I struggle to get any meaningful data outside of net.sf.ehcache.statistics.StatisticsGateway that actually reflect the cache state (based on configured max keys or bytes). There are also heap, non-heap, disk limits so it might not fit into a single utilization meter. Hazelcast Seems to be possible, but what do we want to actually measure here. Whole map/cache utilization (empty for clients) or client near cache? I would be happy to submit a PR with Caffeine specific gauge only. |
@the-thing thank you for the analysis and offer to help with a PR. |
Issue #393 defines some standard cache metrics. However it lacks the cache utilization (in percent), that cannot be calculated from the existing exposed metrics either.
Monitoring the cache utilization is required to trigger early alerts to have enough time for a reconfiguration before the cache actually runs full, starts to evict elements and potentially slows down the system.
The text was updated successfully, but these errors were encountered: