lucasbru commented on code in PR #18809:
URL: https://github.com/apache/kafka/pull/18809#discussion_r1958383366


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/metrics/GroupCoordinatorMetricsShard.java:
##########
@@ -410,66 +372,4 @@ public void onShareGroupStateTransition(
             }
         }
     }
-    
-    /**
-     * Called when a streams group's state has changed. Increment/decrement
-     * the counter accordingly.
-     *
-     * @param oldState The previous state. null value means that it's a new 
group.
-     * @param newState The next state. null value means that the group has 
been removed.
-     */
-    public void onStreamsGroupStateTransition(
-        StreamsGroupState oldState,
-        StreamsGroupState newState
-    ) {
-        if (newState != null) {
-            switch (newState) {
-                case EMPTY:
-                    incrementNumStreamsGroups(StreamsGroupState.EMPTY);
-                    break;
-                case NOT_READY:
-                    incrementNumStreamsGroups(StreamsGroupState.NOT_READY);
-                    break;
-                case ASSIGNING:
-                    incrementNumStreamsGroups(StreamsGroupState.ASSIGNING);
-                    break;
-                case RECONCILING:
-                    incrementNumStreamsGroups(StreamsGroupState.RECONCILING);
-                    break;
-                case STABLE:
-                    incrementNumStreamsGroups(StreamsGroupState.STABLE);
-                    break;
-                case DEAD:
-                    incrementNumStreamsGroups(StreamsGroupState.DEAD);
-                    break;
-                default:

Review Comment:
   yes, the team working on consumer groups realized that the group counts can 
become incorrect easily using this approach. Instead, all groups now use a 
timer that regularly updates the streams group metrics to be equal to the 
number of groups (instead of incremening/decrementing when groups are created 
and deleted).



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to