rocketmq icon indicating copy to clipboard operation
rocketmq copied to clipboard

[Bug] Fix tiered store cache count and bytes metrics

Open majialoong opened this issue 1 month ago • 0 comments

Before Creating the Bug Report

  • [x] I found a bug, not just asking a question, which should be created in GitHub Discussions.

  • [x] I have searched the GitHub Issues and GitHub 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(), 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(), 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

majialoong avatar Nov 30 '25 14:11 majialoong