szilard-nemeth commented on a change in pull request #3430:
URL: https://github.com/apache/hadoop/pull/3430#discussion_r711729156



##########
File path: 
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/LeafQueue.java
##########
@@ -2352,17 +2352,17 @@ private void updateQueuePreemptionMetrics(RMContainer 
rmc) {
     final long usedMillis = rmc.getFinishTime() - rmc.getCreationTime();
     final long usedSeconds = usedMillis / DateUtils.MILLIS_PER_SECOND;
     Resource containerResource = rmc.getAllocatedResource();
-    metrics.preemptContainer();
+    usageTracker.getMetrics().preemptContainer();
     long mbSeconds = (containerResource.getMemorySize() * usedMillis)
         / DateUtils.MILLIS_PER_SECOND;
     long vcSeconds = (containerResource.getVirtualCores() * usedMillis)
         / DateUtils.MILLIS_PER_SECOND;
-    metrics.updatePreemptedMemoryMBSeconds(mbSeconds);
-    metrics.updatePreemptedVcoreSeconds(vcSeconds);
-    metrics.updatePreemptedResources(containerResource);
-    metrics.updatePreemptedSecondsForCustomResources(containerResource,
+    usageTracker.getMetrics().updatePreemptedMemoryMBSeconds(mbSeconds);
+    usageTracker.getMetrics().updatePreemptedVcoreSeconds(vcSeconds);
+    usageTracker.getMetrics().updatePreemptedResources(containerResource);
+    
usageTracker.getMetrics().updatePreemptedSecondsForCustomResources(containerResource,
         usedSeconds);
-    metrics.updatePreemptedForCustomResources(containerResource);
+    
usageTracker.getMetrics().updatePreemptedForCustomResources(containerResource);

Review comment:
       Good point, fixed it.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to