You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2022/01/31 05:54:05 UTC

[GitHub] [incubator-yunikorn-core] anuraagnalluri commented on a change in pull request #357: [YUNIKORN-960] Expose cluster utilization info in new REST calls

anuraagnalluri commented on a change in pull request #357:
URL: https://github.com/apache/incubator-yunikorn-core/pull/357#discussion_r795361831



##########
File path: pkg/webservice/handlers.go
##########
@@ -670,8 +670,11 @@ func getPartitionInfoDAO(lists map[string]*scheduler.PartitionContext) []*dao.Pa
 		partitionInfo.LastStateTransitionTime = partitionContext.GetStateTime().String()
 
 		capacityInfo := dao.PartitionCapacity{}
-		capacityInfo.Capacity = partitionContext.GetTotalPartitionResource().DAOString()
-		capacityInfo.UsedCapacity = partitionContext.GetAllocatedResource().DAOString()
+		capacity := partitionContext.GetTotalPartitionResource()

Review comment:
       I set the `DAOString()` to `capacityInfo.Capacity` on 675 below. On 677, I use this calculation to get the abs used capacity. If I don't store the calculation itself in its own variable, I either have to convert the string to `*resource.Resource` or recompute the capacity as an arg to `CalculateAbsUsedCapacity`.  




-- 
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: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org