Skip to content

[ISSUE #9589] Optimize broker metrics initialization#9598

Merged
lizhimins merged 1 commit intoapache:developfrom
qianye1001:metrics
Aug 12, 2025
Merged

[ISSUE #9589] Optimize broker metrics initialization#9598
lizhimins merged 1 commit intoapache:developfrom
qianye1001:metrics

Conversation

@qianye1001
Copy link
Copy Markdown
Contributor

Which Issue(s) This PR Fixes

Fixes #9589

Brief Description

How Did You Test This Change?

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 6, 2025

Codecov Report

❌ Patch coverage is 22.91667% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.95%. Comparing base (2791833) to head (640157a).
⚠️ Report is 6 commits behind head on develop.

Files with missing lines Patch % Lines
.../java/org/apache/rocketmq/common/BrokerConfig.java 25.00% 24 Missing ⚠️
.../rocketmq/broker/metrics/BrokerMetricsManager.java 18.75% 5 Missing and 8 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #9598      +/-   ##
=============================================
- Coverage      48.14%   47.95%   -0.20%     
+ Complexity     12075    12039      -36     
=============================================
  Files           1313     1313              
  Lines          92791    92836      +45     
  Branches       11866    11868       +2     
=============================================
- Hits           44675    44519     -156     
- Misses         42620    42788     +168     
- Partials        5496     5529      +33     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread common/src/main/java/org/apache/rocketmq/common/BrokerConfig.java
}

private void initStatsMetrics() {
if (!brokerConfig.isEnableStatsMetrics()) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

开关应该统一在初始化外比较好

@lizhimins lizhimins merged commit 9e2445e into apache:develop Aug 12, 2025
12 of 16 checks passed
hechen0 pushed a commit to hechen0/rocketmq that referenced this pull request Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Optimize broker metrics, add config for on-demand initialization

4 participants