Skip to content

[Bug] Fix tiered store cache count and bytes metrics #9885

@majialoong

Description

@majialoong

Before Creating the Bug Report

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

  • I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.

  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions