You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/08/10 01:20:49 UTC

[GitHub] [iotdb] SpriCoder commented on a diff in pull request #6923: [IOTDB-4038] Add the leader metrics to the cluster

SpriCoder commented on code in PR #6923:
URL: https://github.com/apache/iotdb/pull/6923#discussion_r941296800


##########
confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java:
##########
@@ -327,7 +327,8 @@ private void updateNodeLoadStatistic() {
       broadcastLatestRegionRouteMap();
     }
     if (nodeCacheMap.size() == getNodeManager().getRegisteredNodeCount()) {
-      addMetrics();
+      addNodeMetrics();
+      addLeaderCount();

Review Comment:
   From my perspective, it's a good idea to maintain variable that hold the number you need, and you can just update the value of the variable when it's truly update.
   As for metric, I think you can use autogauge metric to monitor the value of the variable above(you can see the use of getOrCreateAutoGauge() method in MetricsService).
   Besides, you can try to abstract all the metric operation into a util class which not only hold the variable but also setup all metrics. 



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

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