Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[ISSUE #8223] Add two metrics rocketmq_topic_number and rocketmq_consumer_group_number #8225

Merged
RongtongJin merged 13 commits intoapache:developapache/rocketmq:developfrom
Stephanie0002:addm2Stephanie0002/rocketmq:addm2Copy head branch name to clipboard
May 31, 2024
Merged

[ISSUE #8223] Add two metrics rocketmq_topic_number and rocketmq_consumer_group_number #8225
RongtongJin merged 13 commits intoapache:developapache/rocketmq:developfrom
Stephanie0002:addm2Stephanie0002/rocketmq:addm2Copy head branch name to clipboard

Conversation

@Stephanie0002
Copy link
Copy Markdown
Contributor

@Stephanie0002 Stephanie0002 commented May 29, 2024

Which Issue(s) This PR Fixes

Fixes #8223

Brief Description

Add two metrics rocketmq_topic_number and rocketmq_consumer_group_number as following:

Type Name Unit Description Label
Gauge rocketmq_topic_number count The number o topics cluster,node_type,node_id
Gauge rocketmq_consumer_group_number count The number of consumer group cluster,node_type,node_id

How Did You Test This Change?

  1. Anticipated use of gauge type metric
    Gauge: A metric that can be incremented or decremented, used to describe the current state of a particular indicator, such as the remaining system memory.

  2. Add metric variables to the BrokerMetricsManager class: activeTopicNum, activeSubGroupNum

  3. Add corresponding constants to the BrokerMetricsConstant class

  4. Build corresponding metrics inside the initStatsMetrics method of the BrokerMetricsManager class

  5. Write a gauge update callback function that refreshes periodically
    a. Call this.brokerController.topicConfigManager.getTopicConfigTable().size() to retrieve the number of topics.
    b. Call brokerController.getSubscriptionGroupManager().getSubscriptionGroupTable().size() to obtain the number of subscription groups.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 29, 2024

Codecov Report

Attention: Patch coverage is 41.11111% with 53 lines in your changes missing coverage. Please review.

Project coverage is 42.90%. Comparing base (9c8fdb7) to head (41ade60).
Report is 102 commits behind head on develop.

Files Patch % Lines
.../rocketmq/broker/metrics/BrokerMetricsManager.java 9.09% 40 Missing ⚠️
...ocketmq/broker/processor/AdminBrokerProcessor.java 66.66% 8 Missing and 5 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #8225      +/-   ##
=============================================
- Coverage      42.94%   42.90%   -0.05%     
+ Complexity     10383    10377       -6     
=============================================
  Files           1270     1271       +1     
  Lines          88727    88785      +58     
  Branches       11407    11408       +1     
=============================================
- Hits           38108    38095      -13     
- Misses         45925    45988      +63     
- Partials        4694     4702       +8     

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

黄梓淇 added 4 commits May 30, 2024 18:01
…ription_number

Signed-off-by: 黄梓淇 <me@U-0MV57FM9-2309.local>
# Conflicts:
#	broker/src/main/java/org/apache/rocketmq/broker/metrics/BrokerMetricsConstant.java
#	broker/src/main/java/org/apache/rocketmq/broker/metrics/BrokerMetricsManager.java
Signed-off-by: 黄梓淇 <me@U-0MV57FM9-2309.local>
@Stephanie0002 Stephanie0002 changed the title [ISSUE #8223] Add two metrics rocketmq_active_topic_number and rocketmq_active_subscription_number [ISSUE #8223] Add two metrics rocketmq_topic_number and rocketmq_consumer_group_number May 31, 2024
@RongtongJin RongtongJin merged commit a430796 into apache:develop May 31, 2024
RongtongJin pushed a commit that referenced this pull request Jul 19, 2025
…umer_group_number (#8225)

* Add tow metric createTopicTime and createSubscriptionTime in broker

* roll back BrokerConfig.java

* Add metric view of createTopicTime and createSubscriptionTime in broker

* Add two metric rocketmq_active_topic_number and rocketmq_active_subscription_number

* Add two metric rocketmq_active_topic_number and rocketmq_active_subscription_number

Signed-off-by: 黄梓淇 <me@U-0MV57FM9-2309.local>

---------

Signed-off-by: 黄梓淇 <me@U-0MV57FM9-2309.local>
Co-authored-by: 黄梓淇 <me@U-0MV57FM9-2309.local>
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.

[Feature] Add two metrics rocketmq_active_topic_number and rocketmq_active_subscription_number

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.