You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2023/01/18 16:05:47 UTC

[GitHub] [helix] qqu0127 commented on a diff in pull request #2340: Add metrics for rebalance throttled because of error partition

qqu0127 commented on code in PR #2340:
URL: https://github.com/apache/helix/pull/2340#discussion_r1073739996


##########
helix-core/src/main/java/org/apache/helix/monitoring/mbeans/ClusterStatusMonitor.java:
##########
@@ -1121,4 +1120,13 @@ public long getPendingStateTransitionGuage() {
     }
     return total;
   }
+
+  @Override
+  public long getRebalanceThrottledByErrorPartition() {
+    long total = 0;
+    for (Map.Entry<String, ResourceMonitor> entry : _resourceMonitorMap.entrySet()) {

Review Comment:
   Performance wise, Lambda/stream is not necessarily slower than for-loop, we also have parallel stream. Besides, benchmarking and then optimizing is the usual way for performance optimization.
   
   I don't have strong opinion on either approach, but if you go with forloop, you can simply use `Map.values()` if you don't care about keys.



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org