[ 
https://issues.apache.org/jira/browse/YARN-11965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18089299#comment-18089299
 ] 

ASF GitHub Bot commented on YARN-11965:
---------------------------------------

zhengchenyu commented on code in PR #8547:
URL: https://github.com/apache/hadoop/pull/8547#discussion_r3418678094


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesForCSWithPartitions.java:
##########
@@ -338,6 +338,47 @@ public void testSchedulerPartitionsXML(boolean 
pLegacyQueueMode)
     verifySchedulerInfoXML(dom);
   }
 
+  @MethodSource("getParameters")
+  @ParameterizedTest(name = "{index}: legacy-queue-mode={0}")
+  public void testClusterMetricsWithPartitions(boolean pLegacyQueueMode)
+      throws Exception {
+    initTestRMWebServicesForCSWithPartitions(pLegacyQueueMode);
+    WebTarget r = targetWithJsonObject();
+    Response response = r.path("ws").path("v1").path("cluster")
+        
.path("metrics").request(MediaType.APPLICATION_JSON).get(Response.class);

Review Comment:
   Added the unit test for xml response.





> Support partition-aware resource metrics in RM cluster metrics REST API
> -----------------------------------------------------------------------
>
>                 Key: YARN-11965
>                 URL: https://issues.apache.org/jira/browse/YARN-11965
>             Project: Hadoop YARN
>          Issue Type: Improvement
>            Reporter: Chenyu Zheng
>            Assignee: Chenyu Zheng
>            Priority: Major
>              Labels: pull-request-available
>
> When node labels are enabled, different labels represent separate resource 
> pools. However, the RM REST API `/ws/v1/cluster/metrics` currently exposes 
> fields such as totalMB and totalVirtualCores based on the default partition 
> only. As a result, resources from non-default partitions are not visible to 
> external resource management systems, which may incorrectly determine that 
> the cluster has no available capacity after new labels are added.
> The API should expose cluster resource metrics across all partitions and 
> provide partition-level metrics so clients can distinguish capacity and usage 
> by node label.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to