craigcondit commented on a change in pull request #323:
URL: 
https://github.com/apache/incubator-yunikorn-core/pull/323#discussion_r710214898



##########
File path: pkg/scheduler/objects/node.go
##########
@@ -552,6 +552,22 @@ func (sn *Node) UnReserveApps() ([]string, []int) {
        return appReserve, askRelease
 }
 
+// Gets map of name -> resource usages per type in shares (0 to 1). Can return 
NaN.
+func (sn *Node) GetResourceUsageShares() map[string]float64 {
+       sn.RLock()
+       defer sn.RUnlock()
+       res := make(map[string]float64)
+       used := resources.Add(sn.allocatedResource, sn.occupiedResource)
+       if sn.totalResource == nil {
+               // no resources present, so no usage
+               return res
+       }
+       for k, v := range sn.totalResource.Resources {

Review comment:
       I think total is correct here, as that includes all the resource types 
available on a node, and therefore all the ones we should be considering for 
scoring.
   




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


Reply via email to