This is an automated email from the ASF dual-hosted git repository.

rexxiong pushed a commit to branch branch-0.5
in repository https://gitbox.apache.org/repos/asf/celeborn.git


The following commit(s) were added to refs/heads/branch-0.5 by this push:
     new c78559cb7 [CELEBORN-1581] Fix incorrect metrics of 
DeviceCelebornFreeBytes and DeviceCelebornTotalBytes
c78559cb7 is described below

commit c78559cb73b58da0b16b8692c4dcc9c48f3a538e
Author: mingji <[email protected]>
AuthorDate: Tue Aug 27 20:38:36 2024 +0800

    [CELEBORN-1581] Fix incorrect metrics of DeviceCelebornFreeBytes and 
DeviceCelebornTotalBytes
    
    ### What changes were proposed in this pull request?
    Fix incorrect metrics.
    
    ### Why are the changes needed?
    The variable `statusSystem.workers` is a set that caused metrics output to 
be incorrect.
    
    ### Does this PR introduce _any_ user-facing change?
    NO.
    
    ### How was this patch tested?
    GA.
    
    <img width="729" alt="截屏2024-08-27 16 48 35" 
src="https://github.com/user-attachments/assets/c221b680-917a-4207-91fc-c142fac64b65";>
    
    Closes #2708 from FMX/b1581.
    
    Authored-by: mingji <[email protected]>
    Signed-off-by: Shuang <[email protected]>
    (cherry picked from commit cdb5d21d12fa581987591cac18824d2342d3008f)
    Signed-off-by: Shuang <[email protected]>
---
 .../main/scala/org/apache/celeborn/service/deploy/master/Master.scala | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/master/src/main/scala/org/apache/celeborn/service/deploy/master/Master.scala 
b/master/src/main/scala/org/apache/celeborn/service/deploy/master/Master.scala
index 0a4a5d5a6..232a2cf70 100644
--- 
a/master/src/main/scala/org/apache/celeborn/service/deploy/master/Master.scala
+++ 
b/master/src/main/scala/org/apache/celeborn/service/deploy/master/Master.scala
@@ -249,11 +249,11 @@ private[celeborn] class Master(
   }
 
   masterSource.addGauge(MasterSource.DEVICE_CELEBORN_TOTAL_CAPACITY) { () =>
-    statusSystem.workers.asScala.map(_.totalSpace()).sum
+    statusSystem.workers.asScala.toList.map(_.totalSpace()).sum
   }
 
   masterSource.addGauge(MasterSource.DEVICE_CELEBORN_FREE_CAPACITY) { () =>
-    statusSystem.workers.asScala.map(_.totalActualUsableSpace()).sum
+    statusSystem.workers.asScala.toList.map(_.totalActualUsableSpace()).sum
   }
 
   masterSource.addGauge(MasterSource.IS_ACTIVE_MASTER) { () => isMasterActive }

Reply via email to