You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "xiangfu0 (via GitHub)" <gi...@apache.org> on 2024/02/18 12:13:02 UTC

Re: [PR] Remove all table metrics when a table is deleted [pinot]

xiangfu0 commented on code in PR #12403:
URL: https://github.com/apache/pinot/pull/12403#discussion_r1493752165


##########
pinot-server/src/main/java/org/apache/pinot/server/starter/helix/SegmentMessageHandlerFactory.java:
##########
@@ -173,6 +177,17 @@ public HelixTaskResult handleMessage()
       try {
         _instanceDataManager.deleteTable(_tableNameWithType);
         helixTaskResult.setSuccess(true);
+        Arrays.stream(ServerMeter.values())
+            .filter(m -> !m.isGlobal())
+            .forEach(m -> _metrics.removeTableMeter(_tableNameWithType, m));
+        Arrays.stream(ServerGauge.values())
+            .filter(g -> !g.isGlobal())
+            .forEach(g -> _metrics.removeTableGauge(_tableNameWithType, g));
+        Arrays.stream(ServerTimer.values())
+            .filter(t -> !t.isGlobal())
+            .forEach(t -> _metrics.removeTableTimer(_tableNameWithType, t));
+        Arrays.stream(ServerQueryPhase.values())
+            .forEach(p -> _metrics.removePhaseTiming(_tableNameWithType, p));
       } catch (Exception e) {
         _metrics.addMeteredTableValue(_tableNameWithType, ServerMeter.DELETE_TABLE_FAILURES, 1);

Review Comment:
   this `ServerMeter.DELETE_TABLE_FAILURES` is also a table level metrics right?



-- 
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@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org