YARN-10116. Expose diagnostics in RMAppManager summary
This commit is contained in:
parent
ce7b8b5634
commit
314e2f9d2e
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user