platinumhamburg commented on code in PR #1466:
URL: https://github.com/apache/fluss/pull/1466#discussion_r2250900787


##########
fluss-server/src/main/java/com/alibaba/fluss/server/coordinator/event/CoordinatorEventManager.java:
##########
@@ -121,6 +126,33 @@ public void clearAndPut(CoordinatorEvent event) {
                 });
     }
 
+    private Histogram getOrCreateEventProcessTimeHistogram(
+            Class<? extends CoordinatorEvent> eventType) {
+        return eventProcessTimeByType.computeIfAbsent(
+                eventType,
+                type -> {
+                    String eventTypeName = type.getSimpleName();
+                    MetricGroup eventTypeGroup =
+                            coordinatorMetricGroup.addGroup("event_type", 
eventTypeName);

Review Comment:
   Currently, in our metric system implementation, all metrics within the same 
MetricGroup share a common variables map. This means that reported metrics 
cannot distinguish between different event_type values within the same 
MetricGroup.
   
   The addGroup() method creates (if absent) a child MetricGroup, which 
inherits the variable map from its parent group while adding additional labels 
(such as event_type) for it. This design is intentional to support our 
implementation requirements.
   
   Furthermore, with the current implementation, metrics can be filtered and 
aggregated as expected.
   
   > Instead of using `addGroup`, I'm thinking that could we use `variables` 
here? Then we can use variables to filter or combine metrics for different 
event types.
   
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to