lifeSo commented on code in PR #1400:
URL: 
https://github.com/apache/incubator-uniffle/pull/1400#discussion_r1442849366


##########
server/src/main/java/org/apache/uniffle/server/ShuffleServerMetrics.java:
##########
@@ -345,5 +358,33 @@ private static void setUpMetrics() {
     summaryTotalRemoveResourceTime = 
metricsManager.addSummary(TOTAL_REMOVE_RESOURCE_TIME);
     summaryTotalRemoveResourceByShuffleIdsTime =
         metricsManager.addSummary(TOTAL_REMOVE_RESOURCE_BY_SHUFFLE_IDS_TIME);
+
+    gaugeDataSizeTotalUsage =
+        Gauge.build()
+            .name(TOPN_OF_TOTAL_DATA_SIZE_FOR_APP)
+            .help("top N of total shuffle data size for app level")
+            .labelNames("topn_of_total_data_size_for_app")

Review Comment:
   @zuston 
   
   This is the first initialization in setUpMetrics() in 
ShuffleServerMetrics.java, and to make gaugeDataSizeTotalUsage not be null.
   
   The real metric cals is in incStorageSuccessCounter() in 
TopNShuffleDataSizeOfAppCalcTask.java.
   eg:
   `   List<Map.Entry<String, ShuffleTaskInfo>> topNTaskInfo =
           calcTopNTotalDataSizeTaskInfo();
       gaugeTotalDataSize.clear();
       for (Map.Entry<String, ShuffleTaskInfo> taskInfo : topNTaskInfo) {
         
gaugeTotalDataSize.labels(taskInfo.getKey()).set(taskInfo.getValue().getTotalDataSize());
       }
   `
   
   In order to no make misunderstand, how about I delete the init and add null 
check ? 



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to