Repository: tez Updated Branches: refs/heads/TEZ-2980 9335a9370 -> 3fb2a657a
TEZ-3080. Tez UI 2: Ensure UI 2 is in-line with UI 1 (sree) Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/3fb2a657 Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/3fb2a657 Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/3fb2a657 Branch: refs/heads/TEZ-2980 Commit: 3fb2a657a9ef66e9fa23c58717c212fcb0cd0592 Parents: 9335a93 Author: Sreenath Somarajapuram <[email protected]> Authored: Tue Feb 2 03:34:39 2016 +0530 Committer: Sreenath Somarajapuram <[email protected]> Committed: Tue Feb 2 03:34:39 2016 +0530 ---------------------------------------------------------------------- TEZ-2980-CHANGES.txt | 1 + .../main/webapp/app/controllers/app/index.js | 12 +++++ .../main/webapp/app/controllers/vertex/index.js | 28 +++++++++++ tez-ui2/src/main/webapp/app/models/timeline.js | 5 +- tez-ui2/src/main/webapp/app/models/vertex.js | 5 ++ .../src/main/webapp/app/serializers/timeline.js | 14 ++++++ .../src/main/webapp/app/serializers/vertex.js | 5 ++ .../main/webapp/app/styles/details-page.less | 8 ++- tez-ui2/src/main/webapp/app/styles/shared.less | 13 +++++ .../src/main/webapp/app/templates/app/index.hbs | 4 +- .../main/webapp/app/templates/attempt/index.hbs | 12 +++++ .../src/main/webapp/app/templates/dag/index.hbs | 11 ++++ .../main/webapp/app/templates/task/index.hbs | 12 +++++ .../main/webapp/app/templates/vertex/index.hbs | 53 ++++++++++++++++++-- .../tests/unit/controllers/app/index-test.js | 1 + 15 files changed, 176 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/3fb2a657/TEZ-2980-CHANGES.txt ---------------------------------------------------------------------- diff --git a/TEZ-2980-CHANGES.txt b/TEZ-2980-CHANGES.txt index 38f474a..b653e42 100644 --- a/TEZ-2980-CHANGES.txt +++ b/TEZ-2980-CHANGES.txt @@ -32,3 +32,4 @@ ALL CHANGES: TEZ-3062. Tez UI 2: Integrate graphical view TEZ-3058. Tez UI 2: Add download data functionality TEZ-3084. Tez UI 2: Display caller type and info + TEZ-3080. Tez UI 2: Ensure UI 2 is in-line with UI 1 http://git-wip-us.apache.org/repos/asf/tez/blob/3fb2a657/tez-ui2/src/main/webapp/app/controllers/app/index.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/controllers/app/index.js b/tez-ui2/src/main/webapp/app/controllers/app/index.js index 9745328..cf199f8 100644 --- a/tez-ui2/src/main/webapp/app/controllers/app/index.js +++ b/tez-ui2/src/main/webapp/app/controllers/app/index.js @@ -16,7 +16,19 @@ * limitations under the License. */ +import Ember from 'ember'; import PageController from '../page'; export default PageController.extend({ + + trackingURL: Ember.computed("model.appID", function () { + console.log(this.get("hosts.rm")); + return [ + this.get("hosts.rm"), + this.get("env.app.namespaces.web.rm"), + "app", + this.get("model.appID") + ].join("/"); + }) + }); http://git-wip-us.apache.org/repos/asf/tez/blob/3fb2a657/tez-ui2/src/main/webapp/app/controllers/vertex/index.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/controllers/vertex/index.js b/tez-ui2/src/main/webapp/app/controllers/vertex/index.js index 9745328..c14d113 100644 --- a/tez-ui2/src/main/webapp/app/controllers/vertex/index.js +++ b/tez-ui2/src/main/webapp/app/controllers/vertex/index.js @@ -16,7 +16,35 @@ * limitations under the License. */ +import Ember from 'ember'; + import PageController from '../page'; +function taskLinkComputerFactory(name) { + return Ember.computed(name, function () { + var tasks = this.get(name); + + if(tasks) { + return tasks.map(function (task) { + return { + routeName: 'task', + model: task, + text: task + }; + }); + } + }); +} + export default PageController.extend({ + + pathname: Ember.computed(function() { + return window.location.pathname; + }).volatile(), + + firstTasksToStart: taskLinkComputerFactory("model.firstTasksToStart"), + lastTasksToFinish: taskLinkComputerFactory("model.lastTasksToFinish"), + shortestDurationTasks: taskLinkComputerFactory("model.shortestDurationTasks"), + longestDurationTasks: taskLinkComputerFactory("model.longestDurationTasks"), + }); http://git-wip-us.apache.org/repos/asf/tez/blob/3fb2a657/tez-ui2/src/main/webapp/app/models/timeline.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/models/timeline.js b/tez-ui2/src/main/webapp/app/models/timeline.js index 60157d3..ca82193 100644 --- a/tez-ui2/src/main/webapp/app/models/timeline.js +++ b/tez-ui2/src/main/webapp/app/models/timeline.js @@ -82,5 +82,8 @@ export default AbstractModel.extend({ }); return counterHash; - }) + }), + + diagnostics: DS.attr('string'), + }); http://git-wip-us.apache.org/repos/asf/tez/blob/3fb2a657/tez-ui2/src/main/webapp/app/models/vertex.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/models/vertex.js b/tez-ui2/src/main/webapp/app/models/vertex.js index d8f1b43..1f4365b 100644 --- a/tez-ui2/src/main/webapp/app/models/vertex.js +++ b/tez-ui2/src/main/webapp/app/models/vertex.js @@ -106,6 +106,11 @@ export default AMTimelineModel.extend({ maxDuration: DS.attr('number'), avgDuration: DS.attr('number'), + firstTasksToStart: DS.attr("object"), + lastTasksToFinish: DS.attr("object"), + shortestDurationTasks: DS.attr("object"), + longestDurationTasks: DS.attr("object"), + processorClassName: DS.attr('string'), dagID: DS.attr('string'), http://git-wip-us.apache.org/repos/asf/tez/blob/3fb2a657/tez-ui2/src/main/webapp/app/serializers/timeline.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/serializers/timeline.js b/tez-ui2/src/main/webapp/app/serializers/timeline.js index 2f6a0d5..c258c64 100644 --- a/tez-ui2/src/main/webapp/app/serializers/timeline.js +++ b/tez-ui2/src/main/webapp/app/serializers/timeline.js @@ -16,8 +16,20 @@ * limitations under the License. */ +import Ember from 'ember'; + import LoaderSerializer from './loader'; +function getDiagnostics(source) { + var diagnostics = Ember.get(source, 'otherinfo.diagnostics') || ""; + + diagnostics = diagnostics.replace(/\t/g, "  "); + diagnostics = diagnostics.replace(/\[/g, "<div>» "); + diagnostics = diagnostics.replace(/\]/g, "</div>"); + + return diagnostics; +} + export default LoaderSerializer.extend({ primaryKey: 'entity', @@ -33,6 +45,8 @@ export default LoaderSerializer.extend({ startTime: 'otherinfo.startTime', endTime: 'otherinfo.endTime', + diagnostics: getDiagnostics, + _counterGroups: 'otherinfo.counters.counterGroups' } }); http://git-wip-us.apache.org/repos/asf/tez/blob/3fb2a657/tez-ui2/src/main/webapp/app/serializers/vertex.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/serializers/vertex.js b/tez-ui2/src/main/webapp/app/serializers/vertex.js index 1f99f3a..bf074f1 100644 --- a/tez-ui2/src/main/webapp/app/serializers/vertex.js +++ b/tez-ui2/src/main/webapp/app/serializers/vertex.js @@ -44,6 +44,11 @@ export default TimelineSerializer.extend({ maxDuration: 'otherinfo.stats.maxTaskDuration', avgDuration: 'otherinfo.stats.avgTaskDuration', + firstTasksToStart: 'otherinfo.stats.firstTasksToStart', + lastTasksToFinish: 'otherinfo.stats.lastTasksToFinish', + shortestDurationTasks: 'otherinfo.stats.shortestDurationTasks', + longestDurationTasks: 'otherinfo.stats.longestDurationTasks', + processorClassName: getProcessorClass, dagID: 'primaryfilters.TEZ_DAG_ID.0', http://git-wip-us.apache.org/repos/asf/tez/blob/3fb2a657/tez-ui2/src/main/webapp/app/styles/details-page.less ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/styles/details-page.less b/tez-ui2/src/main/webapp/app/styles/details-page.less index 4f65018..b3b1a16 100644 --- a/tez-ui2/src/main/webapp/app/styles/details-page.less +++ b/tez-ui2/src/main/webapp/app/styles/details-page.less @@ -16,13 +16,14 @@ * limitations under the License. */ +@import "bower_components/snippet-ss/less/no"; + .detail-list { display: inline-block; margin: 0 10px 10px 0; table-layout: fixed; - white-space: nowrap; .progress { margin-bottom: 0px; @@ -40,6 +41,11 @@ td { padding: 0px 20px 0px 0px; + white-space: nowrap; + + .ember-view { + display: inline; + } } td:first-child { http://git-wip-us.apache.org/repos/asf/tez/blob/3fb2a657/tez-ui2/src/main/webapp/app/styles/shared.less ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/styles/shared.less b/tez-ui2/src/main/webapp/app/styles/shared.less index 0dc70f7..a96636f 100644 --- a/tez-ui2/src/main/webapp/app/styles/shared.less +++ b/tez-ui2/src/main/webapp/app/styles/shared.less @@ -38,3 +38,16 @@ b { bottom: .2em; } } + +.diagnostics { + padding: 10px; + white-space: pre-line; + + div { + padding-left: 20px; + } +} + +.CodeMirror { + height: auto; +} http://git-wip-us.apache.org/repos/asf/tez/blob/3fb2a657/tez-ui2/src/main/webapp/app/templates/app/index.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/app/index.hbs b/tez-ui2/src/main/webapp/app/templates/app/index.hbs index 3567f32..feaee3a 100644 --- a/tez-ui2/src/main/webapp/app/templates/app/index.hbs +++ b/tez-ui2/src/main/webapp/app/templates/app/index.hbs @@ -55,8 +55,8 @@ </thead> <tbody> <tr> - <td>Application ID</td> - <td>{{model.app.entityID}}</td> + <td>Application Tracking URL</td> + <td><a href={{trackingURL}} target="_blank">{{model.app.entityID}}</a></td> </tr> <tr> <td>Application Name</td> http://git-wip-us.apache.org/repos/asf/tez/blob/3fb2a657/tez-ui2/src/main/webapp/app/templates/attempt/index.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/attempt/index.hbs b/tez-ui2/src/main/webapp/app/templates/attempt/index.hbs index 1d77e25..a8be79f 100644 --- a/tez-ui2/src/main/webapp/app/templates/attempt/index.hbs +++ b/tez-ui2/src/main/webapp/app/templates/attempt/index.hbs @@ -62,6 +62,18 @@ </tr> </tbody> </table> + + {{#if model.diagnostics}} + <div class="panel panel-danger"> + <div class="panel-heading"> + Diagnostics + </div> + <div class="diagnostics"> + {{{model.diagnostics}}} + </div> + </div> + {{/if}} + {{else}} {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/3fb2a657/tez-ui2/src/main/webapp/app/templates/dag/index.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/dag/index.hbs b/tez-ui2/src/main/webapp/app/templates/dag/index.hbs index 7ea00c5..0003a64 100644 --- a/tez-ui2/src/main/webapp/app/templates/dag/index.hbs +++ b/tez-ui2/src/main/webapp/app/templates/dag/index.hbs @@ -78,6 +78,17 @@ {{caller-info type=model.callerType info=model.callerInfo}} {{/if}} + {{#if model.diagnostics}} + <div class="panel panel-danger"> + <div class="panel-heading"> + Diagnostics + </div> + <div class="diagnostics"> + {{{model.diagnostics}}} + </div> + </div> + {{/if}} + {{outlet}} {{else}} http://git-wip-us.apache.org/repos/asf/tez/blob/3fb2a657/tez-ui2/src/main/webapp/app/templates/task/index.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/task/index.hbs b/tez-ui2/src/main/webapp/app/templates/task/index.hbs index b9d98c8..c4b0a5a 100644 --- a/tez-ui2/src/main/webapp/app/templates/task/index.hbs +++ b/tez-ui2/src/main/webapp/app/templates/task/index.hbs @@ -54,6 +54,18 @@ </tr> </tbody> </table> + + {{#if model.diagnostics}} + <div class="panel panel-danger"> + <div class="panel-heading"> + Diagnostics + </div> + <div class="diagnostics"> + {{{model.diagnostics}}} + </div> + </div> + {{/if}} + {{else}} {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/3fb2a657/tez-ui2/src/main/webapp/app/templates/vertex/index.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/vertex/index.hbs b/tez-ui2/src/main/webapp/app/templates/vertex/index.hbs index eb3a477..cac5c92 100644 --- a/tez-ui2/src/main/webapp/app/templates/vertex/index.hbs +++ b/tez-ui2/src/main/webapp/app/templates/vertex/index.hbs @@ -72,12 +72,18 @@ <td>First Task Start Time</td> <td> {{txt model.firstTaskStartTime type="date"}} + {{#if firstTasksToStart}} + [{{em-table-linked-cell content=firstTasksToStart}}] + {{/if}} </td> </tr> <tr> <td>Last Task Finish Time</td> <td> {{txt model.lastTaskFinishTime type="date"}} + {{#if lastTasksToFinish}} + [{{em-table-linked-cell content=lastTasksToFinish}}] + {{/if}} </td> </tr> </tbody> @@ -94,19 +100,40 @@ <tbody> <tr> <td>Total Tasks</td> - <td>{{txt model.totalTasks type="number"}}</td> + <td> + <a href="{{pathname}}/tasks">{{txt model.totalTasks type="number"}} Tasks</a> + </td> </tr> <tr> <td>Successful Tasks</td> - <td>{{txt model.successfulTasks type="number"}}</td> + {{#if model.successfulTasks}} + <td> + <a href="{{pathname}}/tasks?searchText=SUCCEEDED">{{txt model.successfulTasks type="number"}} Succeeded</a> + </td> + {{else}} + <td>{{txt model.successfulTasks type="number"}}</td> + {{/if}} </tr> <tr> <td>Failed Tasks</td> - <td>{{txt model.failedTasks type="number"}}</td> + {{#if model.failedTasks}} + <td> + <a href="{{pathname}}/tasks?searchText=FAILED">{{txt model.failedTasks type="number"}} Failed</a> + </td> + {{else}} + <td>{{txt model.failedTasks type="number"}}</td> + {{/if}} </tr> <tr> <td>Killed Tasks</td> - <td>{{txt model.killedTasks type="number"}}</td> + {{#if model.killedTasks}} + <td> + <a href="{{pathname}}/tasks?searchText=KILLED">{{txt model.killedTasks type="number"}} Killed</a> + </td> + {{else}} + <td>{{txt model.killedTasks type="number"}}</td> + {{/if}} + </tr> <tr> <td>Average Duration</td> @@ -118,16 +145,34 @@ <td>Minimum Duration</td> <td> {{txt model.minDuration type="duration"}} + {{#if shortestDurationTasks}} + [{{em-table-linked-cell content=shortestDurationTasks}}] + {{/if}} </td> </tr> <tr> <td>Maximum Duration</td> <td> {{txt model.maxDuration type="duration"}} + {{#if longestDurationTasks}} + [{{em-table-linked-cell content=longestDurationTasks}}] + {{/if}} </td> </tr> </tbody> </table> + + {{#if model.diagnostics}} + <div class="panel panel-danger"> + <div class="panel-heading"> + Diagnostics + </div> + <div class="diagnostics"> + {{{model.diagnostics}}} + </div> + </div> + {{/if}} + {{else}} {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/3fb2a657/tez-ui2/src/main/webapp/tests/unit/controllers/app/index-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/controllers/app/index-test.js b/tez-ui2/src/main/webapp/tests/unit/controllers/app/index-test.js index 9bd6604..676b1d4 100644 --- a/tez-ui2/src/main/webapp/tests/unit/controllers/app/index-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/controllers/app/index-test.js @@ -32,4 +32,5 @@ test('Basic creation test', function(assert) { }); assert.ok(controller); + assert.ok(controller.trackingURL); });
