YARN-8595. [UI2] Container diagnostic information is missing from container page. Contributed by Akhil PB.

This commit is contained in:
Sunil G 2018-08-01 14:27:54 +05:30
parent a48a0cc7fd
commit d920b9db77
7 changed files with 51 additions and 19 deletions

View File

@ -32,6 +32,7 @@ export default DS.Model.extend({
logsLink: DS.attr('string'), logsLink: DS.attr('string'),
state: DS.attr('string'), state: DS.attr('string'),
appAttemptId: DS.attr('string'), appAttemptId: DS.attr('string'),
diagnosticsInfo: DS.attr('string'),
appId: Ember.computed("id",function () { appId: Ember.computed("id",function () {
var id = this.get("id"); var id = this.get("id");

View File

@ -31,6 +31,7 @@ export default DS.Model.extend({
containerState: DS.attr('string'), containerState: DS.attr('string'),
nodeHttpAddress: DS.attr('string'), nodeHttpAddress: DS.attr('string'),
nodeId: DS.attr('string'), nodeId: DS.attr('string'),
diagnosticsInfo: DS.attr('string'),
startTs: function() { startTs: function() {
return Converter.dateToTimeStamp(this.get("startedTime")); return Converter.dateToTimeStamp(this.get("startedTime"));

View File

@ -40,7 +40,8 @@ export default DS.JSONAPISerializer.extend({
hosts: payload.host, hosts: payload.host,
state: payload.appAttemptState, state: payload.appAttemptState,
logsLink: payload.logsLink, logsLink: payload.logsLink,
appAttemptId: payload.appAttemptId appAttemptId: payload.appAttemptId,
diagnosticsInfo: payload.diagnosticsInfo
} }
}; };

View File

@ -22,11 +22,6 @@ import Converter from 'yarn-ui/utils/converter';
export default DS.JSONAPISerializer.extend({ export default DS.JSONAPISerializer.extend({
internalNormalizeSingleResponse(store, primaryModelClass, payload) { internalNormalizeSingleResponse(store, primaryModelClass, payload) {
var payloadEvents = payload.events,
createdEvent = payloadEvents.filterBy('id', 'YARN_CONTAINER_CREATED')[0],
startedTime = createdEvent? createdEvent.timestamp : Date.now(),
finishedEvent = payloadEvents.filterBy('id', 'YARN_CONTAINER_FINISHED')[0],
finishedTime = finishedEvent? finishedEvent.timestamp : Date.now()
var fixedPayload = { var fixedPayload = {
id: payload.id, id: payload.id,
@ -42,6 +37,7 @@ export default DS.JSONAPISerializer.extend({
containerExitStatus: payload.info.YARN_CONTAINER_EXIT_STATUS, containerExitStatus: payload.info.YARN_CONTAINER_EXIT_STATUS,
containerState: payload.info.YARN_CONTAINER_STATE, containerState: payload.info.YARN_CONTAINER_STATE,
nodeId: payload.info.YARN_CONTAINER_ALLOCATED_HOST + ':' + payload.info.YARN_CONTAINER_ALLOCATED_PORT, nodeId: payload.info.YARN_CONTAINER_ALLOCATED_HOST + ':' + payload.info.YARN_CONTAINER_ALLOCATED_PORT,
diagnosticsInfo: payload.info.YARN_CONTAINER_DIAGNOSTICS_INFO
} }
}; };
return fixedPayload; return fixedPayload;

View File

@ -728,3 +728,12 @@ div.service-action-mask img {
word-wrap: nowrap; word-wrap: nowrap;
overflow: scroll; overflow: scroll;
} }
.diagnostic-info {
pre {
margin-bottom: 0;
white-space: pre-wrap;
border: none;
border-radius: 2px;
}
}

View File

@ -62,5 +62,11 @@
<td><a href="{{prepend-protocol attempt.logsLink}}" target="_blank">Link</a></td> <td><a href="{{prepend-protocol attempt.logsLink}}" target="_blank">Link</a></td>
</tr> </tr>
{{/if}} {{/if}}
{{#if attempt.diagnosticsInfo}}
<tr>
<td>Diagnostics Info</td>
<td>{{attempt.diagnosticsInfo}}</td>
</tr>
{{/if}}
</tbody> </tbody>
</table> </table>

View File

@ -37,6 +37,7 @@
<div class="tab-content"> <div class="tab-content">
<div role="tabpanel" class="tab-pane {{if (eq viewType "graph") "active" ""}}" id="graphViewTab"> <div role="tabpanel" class="tab-pane {{if (eq viewType "graph") "active" ""}}" id="graphViewTab">
<br/><br/> <br/><br/>
<div class="row">
<div class="col-md-7 container-fluid" id={{parent-id}}></div> <div class="col-md-7 container-fluid" id={{parent-id}}></div>
<!-- diag info --> <!-- diag info -->
<div class="col-md-5 container-fluid"> <div class="col-md-5 container-fluid">
@ -56,6 +57,23 @@
</div> </div>
</div> </div>
</div> </div>
{{#unless attemptModel}}
{{#if selected.diagnosticsInfo}}
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
Diagnostic Info for {{selected.id}}
</div>
<div class="diagnostic-info">
<pre>{{selected.diagnosticsInfo}}</pre>
</div>
</div>
</div>
</div>
{{/if}}
{{/unless}}
</div>
<div role="tabpanel" class="tab-pane {{if (eq viewType "grid") "active" ""}}" id="gridViewTab"> <div role="tabpanel" class="tab-pane {{if (eq viewType "grid") "active" ""}}" id="gridViewTab">
{{em-table columns=gridColumns rows=gridRows definition=tableDefinition}} {{em-table columns=gridColumns rows=gridRows definition=tableDefinition}}
</div> </div>