YARN-10116. Expose diagnostics in RMAppManager summary

This commit is contained in:
Jonathan Hung 2020-02-04 13:52:25 -08:00
parent ce7b8b5634
commit 314e2f9d2e
2 changed files with 6 additions and 2 deletions

View File

@ -227,8 +227,8 @@ public static SummaryBuilder createAppSummary(RMApp app) {
== null == null
? "" ? ""
: app.getApplicationSubmissionContext() : app.getApplicationSubmissionContext()
.getNodeLabelExpression()); .getNodeLabelExpression())
.add("diagnostics", app.getDiagnostics());
return summary; return summary;
} }

View File

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