majialoong opened a new issue, #9885: URL: https://github.com/apache/rocketmq/issues/9885
### Before Creating the Bug Report - [x] I found a bug, not just asking a question, which should be created in [GitHub Discussions](https://github.com/apache/rocketmq/discussions). - [x] I have searched the [GitHub Issues](https://github.com/apache/rocketmq/issues) and [GitHub Discussions](https://github.com/apache/rocketmq/discussions) of this repository and believe that this is not a duplicate. - [x] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ. ### Runtime platform environment All ### RocketMQ version develop ### JDK Version All ### Describe the Bug `GAUGE_CACHE_COUNT` and `GAUGE_CACHE_BYTES` in tiered storage use incorrect metric collection logic. ### Steps to Reproduce 1. `GAUGE_CACHE_COUNT` is supposed to represent the current number of cached entries, but it was previously derived from [CacheStats#loadCount()](https://javadoc.io/static/com.github.ben-manes.caffeine/caffeine/2.9.3/index.html?com/github/benmanes/caffeine/cache/stats/CacheStats.html), which actually reports the total number of attempted cache loads. 2. `GAUGE_CACHE_BYTES` is supposed to represent the current total bytes occupied by the cache, but it was previously derived from [Cache#estimatedSize()](https://javadoc.io/static/com.github.ben-manes.caffeine/caffeine/2.9.3/index.html?com/github/benmanes/caffeine/cache/Cache.html), which only reports the approximate number of entries in the cache. ### What Did You Expect to See? Use the correct methods to collect `GAUGE_CACHE_COUNT` and `GAUGE_CACHE_BYTES` metrics. ### What Did You See Instead? Use the incorrect methods to collect metrics. ### Additional Context _No response_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
