You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "Stephanie0002 (via GitHub)" <gi...@apache.org> on 2024/05/29 11:30:04 UTC

[PR] [ISSUE #8223] Add two metrics rocketmq_active_topic_number and rocketmq_active_subscription_number [rocketmq]

Stephanie0002 opened a new pull request, #8225:
URL: https://github.com/apache/rocketmq/pull/8225

   <!-- Please make sure the target branch is right. In most case, the target branch should be `develop`. -->
   
   ### Which Issue(s) This PR Fixes
   
   <!-- Please ensure that the related issue has already been created, and [link this pull request to that issue using keywords](<https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword>) to ensure automatic closure. -->
   
   Fixes #8223 
   ### Brief Description
   
   <!-- Write a brief description for your pull request to help the maintainer understand the reasons behind your changes. -->
   
   Add two metrics rocketmq_active_topic_number and rocketmq_active_subscription_number as following: 
   | Type      | Name   | Unit    | Description   | Label    |
   | --------- | -------------- | ----------- |-----------| ------- |
   | Gauge     | rocketmq_active_topic_number           | count       | The number of current topics    | cluster,node_type,node_id    |
   | Gauge     | rocketmq_active_subscription_number    | count       | The number of current subscription group   | cluster,node_type,node_id   |
   
   ### How Did You Test This Change?
   
   <!-- In order to ensure the code quality of Apache RocketMQ, we expect every pull request to have undergone thorough testing. -->
   
   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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ISSUE #8223] Add two metrics rocketmq_topic_number and rocketmq_consumer_group_number [rocketmq]

Posted by "RongtongJin (via GitHub)" <gi...@apache.org>.
RongtongJin merged PR #8225:
URL: https://github.com/apache/rocketmq/pull/8225


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ISSUE #8223] Add two metrics rocketmq_active_topic_number and rocketmq_active_subscription_number [rocketmq]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #8225:
URL: https://github.com/apache/rocketmq/pull/8225#issuecomment-2137231370

   ## [Codecov](https://app.codecov.io/gh/apache/rocketmq/pull/8225?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: Patch coverage is `36.14458%` with `53 lines` in your changes are missing coverage. Please review.
   > Project coverage is 42.88%. Comparing base [(`9c8fdb7`)](https://app.codecov.io/gh/apache/rocketmq/commit/9c8fdb715f774440009b85da2edbd2ab0278831d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`6d12897`)](https://app.codecov.io/gh/apache/rocketmq/commit/6d12897d6b8059f7647a17bec2ef838590a59ed0?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   | [Files](https://app.codecov.io/gh/apache/rocketmq/pull/8225?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [.../rocketmq/broker/metrics/BrokerMetricsManager.java](https://app.codecov.io/gh/apache/rocketmq/pull/8225?src=pr&el=tree&filepath=broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Fbroker%2Fmetrics%2FBrokerMetricsManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvbWV0cmljcy9Ccm9rZXJNZXRyaWNzTWFuYWdlci5qYXZh) | 9.09% | [40 Missing :warning: ](https://app.codecov.io/gh/apache/rocketmq/pull/8225?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...ocketmq/broker/processor/AdminBrokerProcessor.java](https://app.codecov.io/gh/apache/rocketmq/pull/8225?src=pr&el=tree&filepath=broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Fbroker%2Fprocessor%2FAdminBrokerProcessor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvcHJvY2Vzc29yL0FkbWluQnJva2VyUHJvY2Vzc29yLmphdmE=) | 66.66% | [8 Missing and 5 partials :warning: ](https://app.codecov.io/gh/apache/rocketmq/pull/8225?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@              Coverage Diff              @@
   ##             develop    #8225      +/-   ##
   =============================================
   - Coverage      42.94%   42.88%   -0.06%     
   + Complexity     10379    10371       -8     
   =============================================
     Files           1270     1270              
     Lines          88727    88781      +54     
     Branches       11407    11409       +2     
   =============================================
   - Hits           38101    38075      -26     
   - Misses         45931    45997      +66     
   - Partials        4695     4709      +14     
   ```
   
   
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/rocketmq/pull/8225?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org