-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ISSUE #8223] Add two metrics rocketmq_topic_number and rocketmq_consumer_group_number #8225
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sync the upstream
sync the upstream Signed-off-by: 黄梓淇 <me@U-0MV57FM9-2309.local>
Codecov ReportAttention: Patch coverage is
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. |
…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>
Signed-off-by: 黄梓淇 <me@U-0MV57FM9-2309.local>
GenerousMan
approved these changes
May 31, 2024
RongtongJin
approved these changes
May 31, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which Issue(s) This PR Fixes
Fixes #8223
Brief Description
Add two metrics rocketmq_topic_number and rocketmq_consumer_group_number as following:
How Did You Test This Change?
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.
Add metric variables to the BrokerMetricsManager class:
activeTopicNum
,activeSubGroupNum
Add corresponding constants to the BrokerMetricsConstant class
Build corresponding metrics inside the
initStatsMetrics
method of the BrokerMetricsManager classWrite 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.