-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
Provide API to see if a cache records statistics #7381
Labels
type=enhancement
Make an existing feature better
Comments
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. |
Can you assign this to me? |
PrimroseZhang
added a commit
to YujingZHG/guava
that referenced
this issue
Oct 20, 2024
Provide API to see if a cache records statistics
PrimroseZhang
added a commit
to YujingZHG/guava
that referenced
this issue
Oct 20, 2024
Provide API to see if a cache records statistics Revert commit
PrimroseZhang
added a commit
to YujingZHG/guava
that referenced
this issue
Oct 20, 2024
Provide API to see if a cache records statistics
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
micrometer-metrics/micrometer#5066 and micrometer-metrics/micrometer#5402 (comment) are examples that the proposed API is necessary.
Checklist
I agree to follow the code of conduct.
I have read and understood the contribution guidelines.
I have read and understood Guava's philosophy, and I strongly believe that this proposal aligns with it.
The text was updated successfully, but these errors were encountered: