YARN-10116. Expose diagnostics in RMAppManager summary

(cherry picked from commit 314e2f9d2e)
This commit is contained in:
Jonathan Hung 2020-02-04 13:52:25 -08:00
parent 0b19c8e086
commit aca930402c
2 changed files with 6 additions and 2 deletions

View File

@ -223,8 +223,8 @@ public class RMAppManager implements EventHandler<RMAppManagerEvent>,
== null
? ""
: app.getApplicationSubmissionContext()
.getNodeLabelExpression());
.getNodeLabelExpression())
.add("diagnostics", app.getDiagnostics());
return summary;
}

View File

@ -1083,6 +1083,8 @@ public class TestAppManager extends AppManagerTestBase{
new RMAppMetrics(Resource.newInstance(1234, 56),
10, 1, resourceSecondsMap, new HashMap<>());
when(app.getRMAppMetrics()).thenReturn(metrics);
when(app.getDiagnostics()).thenReturn(new StringBuilder(
"Multiline\n\n\r\rDiagnostics=Diagn,ostic"));
RMAppManager.ApplicationSummary.SummaryBuilder summary =
new RMAppManager.ApplicationSummary().createAppSummary(app);
@ -1105,6 +1107,8 @@ public class TestAppManager extends AppManagerTestBase{
assertTrue(msg.contains("applicationType=MAPREDUCE"));
assertTrue(msg.contains("applicationTags=tag1\\,tag2"));
assertTrue(msg.contains("applicationNodeLabel=test"));
assertTrue(msg.contains("diagnostics=Multiline" + escaped
+ "Diagnostics\\=Diagn\\,ostic"));
}
@Test