You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
if (!cache.isRecordingStats()) {
// Warn a user that the cache doesn't provide statistics.
}
if (cache.isRecordingStats()) {
// Register meters with its statistics.
}
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.
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: