yangwwei commented on a change in pull request #323:
URL:
https://github.com/apache/incubator-yunikorn-core/pull/323#discussion_r710302403
##########
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:
Oh, you are right... sorry, my bad.
Pod could have different asks, we need to consider all the resource types
during calculating the scores.
--
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]