manirajv06 commented on code in PR #665:
URL: https://github.com/apache/yunikorn-core/pull/665#discussion_r1338134141


##########
pkg/scheduler/partition.go:
##########
@@ -781,12 +780,16 @@ func (pc *PartitionContext) removeNodeAllocations(node 
*objects.Node) ([]*object
 
                // the allocation is removed so add it to the list that we 
return
                released = append(released, alloc)
+               releasedContainerByQueue[queue.GetQueuePath()]++
                log.Log(log.SchedPartition).Info("allocation removed from node",
                        zap.String("nodeID", node.NodeID),
                        zap.String("allocationId", allocID))
        }
        // track the number of allocations: decrement the released allocation 
AND increment with the confirmed
        pc.updateAllocationCount(len(confirmed) - len(released))
+       for queuePath, count := range releasedContainerByQueue {
+               metrics.GetQueueMetrics(queuePath).AddReleasedContainers(count)
+       }

Review Comment:
   Instead of one more loop traversal, is it better to just keep 
`metrics.GetQueueMetrics(queue.GetQueuePath()).IncReleasedContainer()` outside 
the if-else block? 



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