Open izeye opened 2 weeks ago
Can you assign me this task
It looks like you're aware of Caffeine's cache -- is there a particular reason you're not using it?
@lowasser As mentioned in the opening comment, I created this for libraries (ex. Micrometer), not for applications.
API(s)
How do you want it to be improved?
It would be nice to provide an API to see if recording statistics in a cache is activated similar to the
Policy.isRecordingStats()
from the Caffeine cache.Why do we need it to be improved?
For libraries that collect metrics from a cache, it would be useful to warn a user that metrics won't be collected properly or not to register meters that produce only zero values by using the proposed API.
Example
Current Behavior
It's not possible to know if a cache records statistics.
Desired Behavior
It would be nice to know if a cache records statistics.
Concrete Use Cases
https://github.com/micrometer-metrics/micrometer/issues/5066 and https://github.com/micrometer-metrics/micrometer/pull/5402#issuecomment-2315785818 are examples that the proposed API is necessary.
Checklist
[X] I agree to follow the code of conduct.
[X] I have read and understood the contribution guidelines.
[X] I have read and understood Guava's philosophy, and I strongly believe that this proposal aligns with it.