Return-Path: X-Original-To: apmail-tez-commits-archive@minotaur.apache.org Delivered-To: apmail-tez-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 49F4310DEE for ; Wed, 10 Dec 2014 03:33:27 +0000 (UTC) Received: (qmail 13251 invoked by uid 500); 10 Dec 2014 03:33:27 -0000 Delivered-To: apmail-tez-commits-archive@tez.apache.org Received: (qmail 13177 invoked by uid 500); 10 Dec 2014 03:33:27 -0000 Mailing-List: contact commits-help@tez.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tez.apache.org Delivered-To: mailing list commits@tez.apache.org Received: (qmail 12488 invoked by uid 99); 10 Dec 2014 03:33:26 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Dec 2014 03:33:26 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id CC75FA2286F; Wed, 10 Dec 2014 03:33:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jeagles@apache.org To: commits@tez.apache.org Date: Wed, 10 Dec 2014 03:33:55 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [32/53] tez git commit: TEZ-1606. Counters View for DAG, Vertex, and Task. (Prakash Ramachandran via hitesh) 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/master Commit: ac20265f2d3941fbab18298fba7398e5becf76b2 Parents: ac8c86b Author: Hitesh Shah Authored: Wed Nov 12 11:43:35 2014 -0800 Committer: Hitesh Shah 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( - '\ - {{view.cellContent.name}}\ - ') - }), - 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( - '\ - {{view.cellContent.value}}\ - ') - }), - 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. +}} + +
+ {{counter-table-component data=counterGroups}} +
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. +}} + + + + + + + + + + + + + {{#each counterGroup in filteredData}} + + + + {{#each counter in counterGroup.counters}} + + + + + {{/each}} + {{/each}} + + +
Counter NameCounter Value
{{input size='60' type='search' results='1' placeholder='Search...' valueBinding='nameFilter'}}
{{unbound counterGroup.displayName}}
{{unbound counter.displayName}}{{unbound counter.value}}
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. -}} - -
- {{counter-table-component data=counterGroups}} -
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. -}} - -
- {{counter-table-component data=counterGroups}} -
\ 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. -}} - -
- {{counter-table-component data=counterGroups}} -
\ 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. -}} - -
- {{counter-table-component data=counterGroups}} -
\ No newline at end of file