You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tez.apache.org by hi...@apache.org on 2014/11/12 20:44:06 UTC
tez git commit: TEZ-1606. Counters View for DAG, Vertex,
and Task. (Prakash Ramachandran via hitesh)
Repository: tez
Updated Branches:
refs/heads/TEZ-8 ac8c86b40 -> ac20265f2
TEZ-1606. Counters View for DAG, Vertex, and Task. (Prakash Ramachandran via hitesh)
Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/ac20265f
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/ac20265f
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/ac20265f
Branch: refs/heads/TEZ-8
Commit: ac20265f2d3941fbab18298fba7398e5becf76b2
Parents: ac8c86b
Author: Hitesh Shah <hi...@apache.org>
Authored: Wed Nov 12 11:43:35 2014 -0800
Committer: Hitesh Shah <hi...@apache.org>
Committed: Wed Nov 12 11:43:35 2014 -0800
----------------------------------------------------------------------
CHANGES.txt | 1 +
.../app/scripts/components/counter-table.js | 89 +++++++-------------
tez-ui/src/main/webapp/app/scripts/router.js | 7 ++
tez-ui/src/main/webapp/app/styles/main.less | 33 ++++++--
.../webapp/app/templates/common/counters.hbs | 21 +++++
.../app/templates/components/counter-table.hbs | 43 ++++++++++
.../main/webapp/app/templates/dag/counters.hbs | 21 -----
.../main/webapp/app/templates/task/counters.hbs | 21 -----
.../app/templates/taskAttempt/counters.hbs | 21 -----
.../webapp/app/templates/vertex/counters.hbs | 21 -----
10 files changed, 131 insertions(+), 147 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tez/blob/ac20265f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index bb5f4d0..c5a6ae3 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -17,6 +17,7 @@ ALL CHANGES:
TEZ-1751. Log view & download links in task and task attempt view.
TEZ-1753. Queue in dags view.
TEZ-1765. Allow dropdown lists in table filters.
+ TEZ-1606. Counters View for DAG, Vertex, and Task.
Release 0.5.2: Unreleased
http://git-wip-us.apache.org/repos/asf/tez/blob/ac20265f/tez-ui/src/main/webapp/app/scripts/components/counter-table.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/components/counter-table.js b/tez-ui/src/main/webapp/app/scripts/components/counter-table.js
index 2ee6b76..80c26dc 100644
--- a/tez-ui/src/main/webapp/app/scripts/components/counter-table.js
+++ b/tez-ui/src/main/webapp/app/scripts/components/counter-table.js
@@ -16,68 +16,43 @@
* limitations under the License.
*/
-App.CounterTableComponent = Ember.Table.EmberTableComponent.extend({
- hasFooter: false,
- hasHeader: true,
- forceFillColumns: true,
- data: null,
+App.CounterTableComponent = Em.Component.extend({
+ layoutName: 'components/counter-table',
+ nameFilter: null,
+ filteredData: function() {
+ var rawData = this.get('data') || [];
+ if (Em.isEmpty(this.nameFilter)) {
+ return rawData;
+ }
- columns: function() {
- var groupColumn = Em.Table.ColumnDefinition.create({
- textAlign: 'text-align-left',
- headerCellName: 'Group',
- getCellContent: function(row) {
- return row.get('counterGroup');
- }
- });
+ var filtered = [],
+ filterStringRegex = new RegExp(this.nameFilter, 'i');
- var nameColumn = Em.Table.ColumnDefinition.create({
- textAlign: 'text-align-left',
- headerCellName: 'Counter Name',
- tableCellViewClass: Em.Table.TableCell.extend({
- template: Em.Handlebars.compile(
- '<span {{bind-attr class=":ember-table-content view.cellContent.isCG:countertable-group-header:countertable-row"}}>\
- {{view.cellContent.name}}\
- </span>')
- }),
- getCellContent: function(row) {
- return {
- isCG: row.get('counters') != undefined,
- name: row.get('name')
- };
- }
- });
+ rawData.forEach(function(cg) {
+ var tmpcg = {
+ name: cg.get('name'),
+ displayName: cg.get('displayName'),
+ counters: []
+ };
+
+ var counters = cg.get('counters');
- var valueColumn = Em.Table.ColumnDefinition.create({
- textAlign: 'text-align-left',
- headerCellName: 'Value',
- tableCellViewClass: Em.Table.TableCell.extend({
- template: Em.Handlebars.compile(
- '<span {{bind-attr class=":ember-table-content view.cellContent.isCG:countertable-group-header"}}>\
- {{view.cellContent.value}}\
- </span>')
- }),
- getCellContent: function(row) {
- return {
- isCG: row.get('counters') != undefined,
- value: row.get('value')
- };
+ if (filterStringRegex.test(tmpcg.displayName)) {
+ // if counter group name matches, match all counters for the group
+ tmpcg.counters = counters;
+ } else {
+ counters.forEach(function(counter) {
+ if (filterStringRegex.test(counter.get('displayName'))) {
+ tmpcg.counters.push(counter);
+ }
+ });
}
- });
- return [nameColumn, valueColumn];
- }.property(),
+ filtered.push(tmpcg);
+ })
- content: function() {
- var allCounters = [];
- if (!!this.data) {
- this.data.forEach(function(cg){
- allCounters.push(cg);
- [].push.apply(allCounters, cg.get('counters').content);
- });
- }
- return allCounters;
- }.property('data'),
+ return filtered;
+ }.property('data', 'nameFilter')
});
-Em.Handlebars.helper('counter-table-component', App.CounterTableComponent);
\ No newline at end of file
+Em.Handlebars.helper('counter-table-component', App.CounterTableComponent);
http://git-wip-us.apache.org/repos/asf/tez/blob/ac20265f/tez-ui/src/main/webapp/app/scripts/router.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/router.js b/tez-ui/src/main/webapp/app/scripts/router.js
index 5da59db..2d86d7d 100644
--- a/tez-ui/src/main/webapp/app/scripts/router.js
+++ b/tez-ui/src/main/webapp/app/scripts/router.js
@@ -66,6 +66,13 @@ App.ApplicationRoute = Em.Route.extend({
}
});*/
+App.DagCountersRoute = App.VertexCountersRoute =
+ App.TaskCountersRoute = App.TaskAttemptCountersRoute = Em.Route.extend({
+ renderTemplate: function() {
+ this.render('common/counters');
+ }
+});
+
App.DagsRoute = Em.Route.extend({
queryParams: {
count: {
http://git-wip-us.apache.org/repos/asf/tez/blob/ac20265f/tez-ui/src/main/webapp/app/styles/main.less
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/styles/main.less b/tez-ui/src/main/webapp/app/styles/main.less
index 2c1714a..240b82d 100644
--- a/tez-ui/src/main/webapp/app/styles/main.less
+++ b/tez-ui/src/main/webapp/app/styles/main.less
@@ -147,12 +147,33 @@ div.indent {
}
}
-.countertable-group-header {
- background-color: lightgray;
-}
+.countertable {
+ width: 100%;
+ .margin-medium;
+
+ th, td {
+ border: 1px solid #dcdcdc;
+ padding: 5px 5px;
+ }
+
+ th, td.filter {
+ background-color: #f0f0f0;
+ font-style: italic;
+ font-weight: bold;
+ }
-.countertable-row {
- margin: 0px 0px 0px 15px;
+ th:first-child {
+ width: 70%;
+ }
+
+ tr {
+ margin: 0px 0px 0px 15px;
+ &.group-header td {
+ background-color: #f8f8f8;
+ font-style: italic;
+ font-weight: bold;
+ }
+ }
}
.inline-display {
@@ -175,4 +196,4 @@ div.indent {
.table-container {
height: 380px;
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/tez/blob/ac20265f/tez-ui/src/main/webapp/app/templates/common/counters.hbs
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/templates/common/counters.hbs b/tez-ui/src/main/webapp/app/templates/common/counters.hbs
new file mode 100644
index 0000000..ecebc21
--- /dev/null
+++ b/tez-ui/src/main/webapp/app/templates/common/counters.hbs
@@ -0,0 +1,21 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+<div class='table-container margin-medium' style='width: 50%;'>
+ {{counter-table-component data=counterGroups}}
+</div>
http://git-wip-us.apache.org/repos/asf/tez/blob/ac20265f/tez-ui/src/main/webapp/app/templates/components/counter-table.hbs
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/templates/components/counter-table.hbs b/tez-ui/src/main/webapp/app/templates/components/counter-table.hbs
new file mode 100644
index 0000000..fbd7616
--- /dev/null
+++ b/tez-ui/src/main/webapp/app/templates/components/counter-table.hbs
@@ -0,0 +1,43 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+<table class='countertable'>
+ <thead>
+ <tr>
+ <th>Counter Name</th>
+ <th>Counter Value</th>
+ </tr>
+ <tr>
+ <td class='filter'>{{input size='60' type='search' results='1' placeholder='Search...' valueBinding='nameFilter'}}</td>
+ <td class='filter'></td>
+ </tr>
+ <tbody>
+ {{#each counterGroup in filteredData}}
+ <tr class='group-header'>
+ <td colspan='2'>{{unbound counterGroup.displayName}}</td>
+ </tr>
+ {{#each counter in counterGroup.counters}}
+ <tr>
+ <td>{{unbound counter.displayName}}</td>
+ <td>{{unbound counter.value}}</td>
+ </tr>
+ {{/each}}
+ {{/each}}
+ </tbody>
+ </thead>
+</table>
http://git-wip-us.apache.org/repos/asf/tez/blob/ac20265f/tez-ui/src/main/webapp/app/templates/dag/counters.hbs
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/templates/dag/counters.hbs b/tez-ui/src/main/webapp/app/templates/dag/counters.hbs
deleted file mode 100644
index ecebc21..0000000
--- a/tez-ui/src/main/webapp/app/templates/dag/counters.hbs
+++ /dev/null
@@ -1,21 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-
-<div class='table-container margin-medium' style='width: 50%;'>
- {{counter-table-component data=counterGroups}}
-</div>
http://git-wip-us.apache.org/repos/asf/tez/blob/ac20265f/tez-ui/src/main/webapp/app/templates/task/counters.hbs
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/templates/task/counters.hbs b/tez-ui/src/main/webapp/app/templates/task/counters.hbs
deleted file mode 100644
index 4c082e1..0000000
--- a/tez-ui/src/main/webapp/app/templates/task/counters.hbs
+++ /dev/null
@@ -1,21 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-
-<div class='table-container margin-medium' style='width: 50%;'>
- {{counter-table-component data=counterGroups}}
-</div>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tez/blob/ac20265f/tez-ui/src/main/webapp/app/templates/taskAttempt/counters.hbs
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/templates/taskAttempt/counters.hbs b/tez-ui/src/main/webapp/app/templates/taskAttempt/counters.hbs
deleted file mode 100644
index 4c082e1..0000000
--- a/tez-ui/src/main/webapp/app/templates/taskAttempt/counters.hbs
+++ /dev/null
@@ -1,21 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-
-<div class='table-container margin-medium' style='width: 50%;'>
- {{counter-table-component data=counterGroups}}
-</div>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tez/blob/ac20265f/tez-ui/src/main/webapp/app/templates/vertex/counters.hbs
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/templates/vertex/counters.hbs b/tez-ui/src/main/webapp/app/templates/vertex/counters.hbs
deleted file mode 100644
index 4c082e1..0000000
--- a/tez-ui/src/main/webapp/app/templates/vertex/counters.hbs
+++ /dev/null
@@ -1,21 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-
-<div class='table-container margin-medium' style='width: 50%;'>
- {{counter-table-component data=counterGroups}}
-</div>
\ No newline at end of file