You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2021/09/01 16:29:40 UTC
[GitHub] [hadoop] goiri commented on a change in pull request #3325: YARN-10893. Adding metrics for getClusterMetrics and getApplications APIs in FederationClientInterceptor
goiri commented on a change in pull request #3325:
URL: https://github.com/apache/hadoop/pull/3325#discussion_r700376659
##########
File path: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm/FederationClientInterceptor.java
##########
@@ -628,18 +629,29 @@ public GetApplicationReportResponse getApplicationReport(
public GetApplicationsResponse getApplications(GetApplicationsRequest request)
throws YarnException, IOException {
if (request == null) {
+ routerMetrics.incrMultipleAppsFailedRetrieved();
RouterServerUtil.logAndThrowException(
"Missing getApplications request.",
null);
}
+ long startTime = clock.getTime();
Map<SubClusterId, SubClusterInfo> subclusters =
federationFacade.getSubClusters(true);
ClientMethod remoteMethod = new ClientMethod("getApplications",
new Class[] {GetApplicationsRequest.class}, new Object[] {request});
- Map<SubClusterId, GetApplicationsResponse> applications =
- invokeConcurrent(subclusters.keySet(), remoteMethod,
- GetApplicationsResponse.class);
+ Map<SubClusterId, GetApplicationsResponse> applications;
+
+ try {
+ applications = invokeConcurrent(subclusters.keySet(), remoteMethod,
+ GetApplicationsResponse.class);
+ } catch (Exception ex) {
Review comment:
What is this exception?
##########
File path: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/TestRouterMetrics.java
##########
@@ -279,6 +279,37 @@ public void testMulipleAppsReportFailed() {
metrics.getMultipleAppsFailedRetrieved());
}
+ /**
+ * This test validates the correctness of the metric: Retrieved getClusterMetrics
+ * multiple times successfully.
+ */
+ @Test
+ public void testSucceededGetClusterMetrics() {
+ long totalGoodBefore = metrics.getNumSucceededGetClusterMetricsRetrieved();
+ goodSubCluster.getClusterMetrics(100);
+ Assert.assertEquals(totalGoodBefore + 1,
+ metrics.getNumSucceededGetClusterMetricsRetrieved());
+ Assert.assertEquals(100, metrics.getLatencySucceededGetClusterMetricsRetrieved(),
+ 0);
Review comment:
What is the last 0?
--
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: common-issues-unsubscribe@hadoop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org