craigcondit commented on a change in pull request #323:
URL:
https://github.com/apache/incubator-yunikorn-core/pull/323#discussion_r710215967
##########
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:
As we're returning the usage (inverse of available), we still need to
walk the structure (or compute total - available). I tried this locally, and
the resulting code is less clear.
--
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]