incubator-blur-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Williams <william...@gmail.com>
Subject Re: [1/4] git commit: Started adding in the table page
Date Thu, 27 Mar 2014 01:07:21 GMT
On Wed, Mar 26, 2014 at 6:31 PM,  <crohr@apache.org> wrote:
> Repository: incubator-blur
> Updated Branches:
>   refs/heads/console-v2 0e2ad4304 -> ef5f913b4
>
>
> Started adding in the table page
>
>
> Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
> Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/cd3c9e83
> Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/cd3c9e83
> Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/cd3c9e83
>
> Branch: refs/heads/console-v2
> Commit: cd3c9e8307d93e8ab102a4251cc6d381f1fc2b20
> Parents: 0e2ad43
> Author: Chris Rohr <crohr@nearinfinity.com>
> Authored: Mon Mar 3 10:55:40 2014 -0500
> Committer: Chris Rohr <crohr@nearinfinity.com>
> Committed: Mon Mar 3 10:55:40 2014 -0500
>
> ----------------------------------------------------------------------
>  contrib/blur-console/ui/app/index.html          |   4 +-
>  .../ui/app/scripts/blurconsole.dashboard.js     |   2 +-
>  .../ui/app/scripts/blurconsole.model.js         |  75 +++++++++--
>  .../ui/app/scripts/blurconsole.tables.js        | 126 +++++++++++++++++++
>  .../ui/app/scripts/blurconsole.utils.js         |  21 +++-
>  .../blur-console/ui/app/views/tables.tpl.html   |  15 +++
>  contrib/blur-console/ui/bower.json              |   7 +-
>  7 files changed, 232 insertions(+), 18 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/cd3c9e83/contrib/blur-console/ui/app/index.html
> ----------------------------------------------------------------------
> diff --git a/contrib/blur-console/ui/app/index.html b/contrib/blur-console/ui/app/index.html
> index 140b922..6a87c68 100644
> --- a/contrib/blur-console/ui/app/index.html
> +++ b/contrib/blur-console/ui/app/index.html
> @@ -66,10 +66,9 @@ limitations under the License.
>
>          <!-- build:js scripts/vendor.js -->
>          <!-- bower:js -->
> -        <script src="bower_components/jquery/jquery.js"></script>
> +        <script src="bower_components/jquery/dist/jquery.js"></script>
>          <script src="lib/jquery.uriAnchor.js"></script>
>          <script src="lib/jquery.event.gevent.js"></script>
> -        <script src="bower_components/taffydb/taffy.js"></script>
>          <!-- endbower -->
>          <!-- endbuild -->
>
> @@ -97,6 +96,7 @@ limitations under the License.
>          <script src="scripts/blurconsole.utils.js"></script>
>          <script src="scripts/blurconsole.shell.js"></script>
>          <script src="scripts/blurconsole.dashboard.js"></script>
> +        <script src="scripts/blurconsole.tables.js"></script>
>          <script src="scripts/blurconsole.data.js"></script>
>          <script src="scripts/blurconsole.fake.js"></script>
>          <script src="scripts/blurconsole.model.js"></script>
>
> http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/cd3c9e83/contrib/blur-console/ui/app/scripts/blurconsole.dashboard.js
> ----------------------------------------------------------------------
> diff --git a/contrib/blur-console/ui/app/scripts/blurconsole.dashboard.js b/contrib/blur-console/ui/app/scripts/blurconsole.dashboard.js
> index 78fcfe7..417ed38 100644
> --- a/contrib/blur-console/ui/app/scripts/blurconsole.dashboard.js
> +++ b/contrib/blur-console/ui/app/scripts/blurconsole.dashboard.js
> @@ -130,7 +130,7 @@ blurconsole.dashboard = (function () {
>         };
>
>         loadQueryPerfLineChart = function() {
> -               $.plot(jqueryMap.$queryLoadChartHolder, [blurconsole.model.metrics.getQueryLoadChartData()],
{
> +               $.plot(jqueryMap.$queryLoadChartHolder, blurconsole.model.metrics.getQueryLoadChartData(),
{
>                         series : {
>                                 shadowSize : 0
>                         },
>
> http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/cd3c9e83/contrib/blur-console/ui/app/scripts/blurconsole.model.js
> ----------------------------------------------------------------------
> diff --git a/contrib/blur-console/ui/app/scripts/blurconsole.model.js b/contrib/blur-console/ui/app/scripts/blurconsole.model.js
> index 063bb8f..a15cd2a 100644
> --- a/contrib/blur-console/ui/app/scripts/blurconsole.model.js
> +++ b/contrib/blur-console/ui/app/scripts/blurconsole.model.js
> @@ -28,10 +28,51 @@ blurconsole.model = (function() {
>                 tables, metrics, initModule, nodePoller, tablePoller, queryPerformancePoller;
>
>         tables = (function() {
> -               var getDb, getNameMap;
> +               var getClusters, getEnabledTables, getDisabledTables;
>
> -               getDb = function() { return stateMap.tableDb; };
> -               getNameMap = function() { return stateMap.tableNameMap; };
> +               getClusters = function() {
> +                       return blurconsole.utils.unique($.map(stateMap.tableNameMap,
function(table){
> +                               return table.cluster;
> +                       }), true);
> +               };
> +
> +               getEnabledTables = function(cluster) {
> +                       var data = [];
> +
> +                       $.each(stateMap.tableNameMap, function(idx, table) {
> +                               if (table.cluster === cluster && table.enabled)
{
> +                                       data.push({name:table.name, rowCount:table.rows,
recordCount:table.records});
> +                               }
> +                       });
> +
> +                       return {
> +                               cols : {
> +                                       name : {
> +                                               index : 1,
> +                                               type : 'string'
> +                                       },
> +                                       rowCount : {
> +                                               index : 2,
> +                                               type : 'number'
> +                                       },
> +                                       recordCount : {
> +                                               index : 3,
> +                                               type : 'number'
> +                                       }
> +                               },
> +                               rows: data
> +                       };
> +               };
> +
> +               getDisabledTables = function(cluster) {
> +                       console.log(cluster);
> +               };
> +
> +               return {
> +                       getClusters : getClusters,
> +                       getEnabledTables : getEnabledTables,
> +                       getDisabledTables : getDisabledTables
> +               };
>         }());
>
>         metrics = (function() {
> @@ -117,13 +158,25 @@ blurconsole.model = (function() {
>                 };
>
>                 getQueryLoadChartData = function() {
> -                       var dataArray = [];
> +                       var total = 0,
> +                               queryArray = [],
> +                               meanArray = [],
> +                               queryData, mean;
> +
> +                       queryData = stateMap.queryPerformance;
> +
> +                       $.each(queryData, function(idx, increment) {
> +                               total += increment;
> +                       });
> +
> +                       mean = queryData.length === 0 ? 0 : total/queryData.length;
>
> -                       $.each(stateMap.queryPerformance, function(idx, increment) {
> -                               dataArray.push([idx, increment]);
> +                       $.each(queryData, function(idx, increment) {
> +                               queryArray.push([idx, increment]);
> +                               meanArray.push([idx, mean]);
>                         });
>
> -                       return dataArray;
> +                       return [queryArray, meanArray];
>                 };
>
>                 buildPieChartData = function(onlineCount, offlineCount) {
> @@ -176,9 +229,11 @@ blurconsole.model = (function() {
>
>         initModule = function() {
>                 configMap.poller = isFakeData ? blurconsole.fake : blurconsole.data;
> -               nodePoller();
> -               tablePoller();
> -               queryPerformancePoller();
> +               setTimeout(function() {
> +                       nodePoller();
> +                       tablePoller();
> +                       queryPerformancePoller();
> +               }, 1000);
>         };
>         return {
>                 initModule : initModule,
>
> http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/cd3c9e83/contrib/blur-console/ui/app/scripts/blurconsole.tables.js
> ----------------------------------------------------------------------
> diff --git a/contrib/blur-console/ui/app/scripts/blurconsole.tables.js b/contrib/blur-console/ui/app/scripts/blurconsole.tables.js
> new file mode 100644
> index 0000000..fca683b
> --- /dev/null
> +++ b/contrib/blur-console/ui/app/scripts/blurconsole.tables.js
> @@ -0,0 +1,126 @@
> +/*
> +
> +Licensed 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.

Why are these source headers abbreviated from normal?

Thanks,
--tim

Mime
View raw message