craigcondit commented on code in PR #691:
URL: https://github.com/apache/yunikorn-core/pull/691#discussion_r1385433240


##########
pkg/common/resources/resources.go:
##########
@@ -993,3 +993,39 @@ func CalculateAbsUsedCapacity(capacity, used *Resource) 
*Resource {
        }
        return absResource
 }
+
+// DominantResourceType calculates the most used resource type based on the 
ratio of used compared to
+// the capacity. If a capacity type is set to 0 assume full usage.
+// Dominant type should be calculated with queue usage and capacity. Queue 
capacities should never
+// contain 0 values when there is a usage also, however in the root queue this 
could happen. If the
+// last node reporting that resource was removed but not everything has been 
updated.
+// immediately
+// Ignores resources types that are used but not defined in the capacity.
+func (r *Resource) DominantResourceType(capacity *Resource) string {

Review Comment:
   I think we should treat zero capacity a bit differently. if a resource has 0 
capacity and 0 usage, just ignore it. If it has > 0 usage, then treat it as 
100%.



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