craigcondit commented on a change in pull request #323:
URL:
https://github.com/apache/incubator-yunikorn-core/pull/323#discussion_r710355009
##########
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)
Review comment:
@yangwwei, I took your offline suggestion to use total - allocated
instead. That does simplify it a bit. Updated PR with changes.
--
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]