zhtaoxiang commented on code in PR #10104: URL: https://github.com/apache/pinot/pull/10104#discussion_r1068778919
########## pinot-common/src/main/java/org/apache/pinot/common/metrics/AbstractMetrics.java: ########## @@ -707,15 +708,16 @@ public void removeTableGauge(final String tableName, final G gauge) { /** + * @deprecated please use removeTableGauge(final String tableName, final String key, final G gauge) instead + * * Removes a table gauge given the table name and the gauge. * The add/remove is expected to work correctly in case of being invoked across multiple threads. * @param tableName table name + * @param partitionId The partition id * @param gauge the gauge to be removed */ public void removePartitionGauge(final String tableName, final int partitionId, final G gauge) { Review Comment: Let me break it down into details: 1. The last parameter of this method is not a `callback` but rather a callable, so I'd like to remove `callback` from the method name. `Callback` normally means it will tell the caller something. 2. The guard is actually not needed, `addCallbackGauge` itself will only add the gauge once, following calls cannot update it (I tested it and find this behavior, that's why I added updatable gauge in another PR https://github.com/apache/pinot/pull/9961). I have a plan to remove `_gaugeValues` entirely. 3. Can you please help me understand why we only need to add the gauge for the first time? I see only one usage, and it seems that it's okay to update the existing gauge. -- 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-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org