Fixing data loading issues in metering and monitoring dashboards

Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/80a73714
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/80a73714
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/80a73714

Branch: refs/heads/master
Commit: 80a737142c58e67669633ed85e8ac3b048d35c4a
Parents: d559479
Author: Thanuja <[email protected]>
Authored: Sun May 8 23:51:08 2016 +0530
Committer: Thanuja <[email protected]>
Committed: Sun May 8 23:51:08 2016 +0530

----------------------------------------------------------------------
 .../artifacts/metering-dashboard/README.md      |   2 +-
 .../Dashboard/metering-dashboard.json           | 181 +++++++++---
 .../MemberCount.siddhiql                        |  42 +++
 .../ExecutionplanMemberCount/artifact.xml       |  19 ++
 .../Application_Signups/js/main.js              |   2 +-
 .../GadgetMemberCount/Member_Count/gadget.json  |   2 +-
 .../GadgetMemberCount/Member_Count/index.xml    |   5 +-
 .../js/d3.geomap.dependencies.min.js            |  24 +-
 .../Member_Count/js/d3.geomap.min.js            |   6 +-
 .../GadgetMemberCount/Member_Count/js/d3.min.js |  22 +-
 .../Member_Count/js/gadgetconf.js               |  21 +-
 .../GadgetMemberCount/Member_Count/js/igviz.js  |  90 +++---
 .../GadgetMemberCount/Member_Count/js/jquery.js |  46 ++--
 .../GadgetMemberCount/Member_Count/js/main.js   |  18 +-
 .../GadgetMemberCount/Member_Count/js/vega.js   |  30 +-
 .../Member_Information/js/main.js               |   2 +-
 .../GadgetMemberStatus/Member_Status/js/main.js |   2 +-
 .../Member_Status_Filter/index.xml              |  20 +-
 .../member_information.xml                      |   2 +-
 .../SparkscriptsMemberLifecycle/artifact.xml    |  35 +--
 .../member_count.xml                            |  55 ----
 .../member_lifecycle.xml                        |  37 +++
 .../stratos-metering-service/artifacts.xml      |   3 +
 .../database-scripts/mysql/metering-script.sql  |   2 -
 .../database-scripts/oracle/metering-script.sql |   7 +-
 .../jaggery-files/mysql/application-signups.jag |  11 +-
 .../jaggery-files/mysql/applications.jag        |   2 +-
 .../jaggery-files/mysql/clusters.jag            |   2 +-
 .../jaggery-files/mysql/member-count.jag        |  39 +--
 .../jaggery-files/mysql/member-info.jag         |  17 +-
 .../jaggery-files/mysql/member-status.jag       |  25 +-
 .../oracle/application-signups.jag              |  11 +-
 .../jaggery-files/oracle/applications.jag       |   2 +-
 .../jaggery-files/oracle/clusters.jag           |   3 +-
 .../jaggery-files/oracle/member-count.jag       |  68 ++---
 .../jaggery-files/oracle/member-info.jag        |  12 +-
 .../jaggery-files/oracle/member-status.jag      |  17 +-
 .../metering-dashboard/ues-patch/README.md      |   8 +-
 .../metering-dashboard/ues-patch/dashboard.jag  | 179 ++++++++----
 .../metering-dashboard/ues-patch/ues-gadgets.js |  41 +--
 .../Dashboard/monitoring-dashboard.json         | 116 +++++---
 .../Dashboard/stratos-monitoring-dashboard.json | 274 -------------------
 .../Health_Stats_Filter/index.xml               |   2 +
 .../In_Flight_Request/js/main.js                |   2 +-
 .../GadgetLoadAverage/Load_Average/js/main.js   |   2 +-
 .../GadgetMemoryUsage/Memory_Usage/js/main.js   |   2 +-
 .../Scaling_Details/js/main.js                  |   2 +-
 .../in_flight_request.xml                       |   2 +-
 .../SparkscriptsLoadAverage/load_average.xml    |   2 +-
 .../SparkscriptsMemoryUsage/memory_usage.xml    |   2 +-
 .../scaling_decision.xml                        |   2 +-
 .../mysql/monitoring-script.sql                 |   1 +
 .../oracle/monitoring-script.sql                |   2 +-
 .../mysql/health-stats-clusters.jag             |   4 +-
 .../mysql/health-stats-members.jag              |   6 +-
 .../jaggery-files/mysql/in-flight-request.jag   |  26 +-
 .../jaggery-files/mysql/load-average.jag        |  34 ++-
 .../jaggery-files/mysql/memory-usage.jag        |  35 ++-
 .../jaggery-files/mysql/scaling-details.jag     |  23 +-
 .../oracle/health-stats-clusters.jag            |   4 +-
 .../oracle/health-stats-members.jag             |   7 +-
 .../jaggery-files/oracle/in-flight-request.jag  |  20 +-
 .../jaggery-files/oracle/load-average.jag       |  20 +-
 .../jaggery-files/oracle/memory-usage.jag       |  20 +-
 .../jaggery-files/oracle/scaling-details.jag    |  16 +-
 extensions/das/modules/distribution/README.md   |   2 +-
 66 files changed, 833 insertions(+), 907 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/README.md
----------------------------------------------------------------------
diff --git a/extensions/das/modules/artifacts/metering-dashboard/README.md 
b/extensions/das/modules/artifacts/metering-dashboard/README.md
index 0a48879..7bf8b2c 100644
--- a/extensions/das/modules/artifacts/metering-dashboard/README.md
+++ b/extensions/das/modules/artifacts/metering-dashboard/README.md
@@ -3,7 +3,7 @@
 ## This directory contains following artifacts:
 
 (1) capps - Includes stratos-metering-service car file which bundles all Event 
Stream, Event receiver, Even Store,
-            Gadgets, SparkScripts and Dashboard artifacts.
+            Execution plan, Gadgets, SparkScripts and Dashboard artifacts.
 
 (2) jaggery-files
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/Dashboard/metering-dashboard.json
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/Dashboard/metering-dashboard.json
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/Dashboard/metering-dashboard.json
index 02c5370..b21cc74 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/Dashboard/metering-dashboard.json
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/Dashboard/metering-dashboard.json
@@ -12,22 +12,47 @@
   },
   "pages": [
     {
-      "id": "member-status",
+      "id": "landing",
       "title": "Member Status",
       "layout": {
-        "id": "single-column",
-        "title": "Single Column",
-        "description": "This is a layout generated through single-column.io",
-        "thumbnail": "store://layout/single-column/index.png",
-        "url": "store://layout/single-column/index.hbs",
-        "content": "<!--\n\n Licensed to the Apache Software Foundation (ASF) 
under one\n or more contributor license agreements.  See the NOTICE file\n 
distributed with this work for additional information\n regarding copyright 
ownership.  The ASF licenses this file\n to you under the Apache License, 
Version 2.0 (the\n \"License\"); you may not use this file except in 
compliance\n with the License.  You may obtain a copy of the License at\n\n   
http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable 
law or agreed to in writing,\n software distributed under the License is 
distributed on an\n \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n 
KIND, either express or implied.  See the License for the\n specific language 
governing permissions and limitations\n under the License.\n\n-->\n<div 
class=\"container\">\n<div class=\"row\">\n    <div id=\"a\" class=\"col-md-12 
ues-component-box\"></div>\n    <div id=\"b\" class=\"col-md-12 
ues-component-box\"></div
 >\n    <div id=\"c\" class=\"col-md-12 
 >ues-component-box\"></div>\n</div>\n</div>\n"
+        "content": {
+          "loggedIn": {
+            "blocks": [
+              {
+                "id": "a",
+                "col": 1,
+                "row": 1,
+                "size_x": 12,
+                "size_y": 2,
+                "banner": false
+              },
+              {
+                "id": "b",
+                "col": 1,
+                "row": 3,
+                "size_x": 12,
+                "size_y": 5,
+                "banner": false
+              },
+              {
+                "id": "c",
+                "col": 1,
+                "row": 8,
+                "size_x": 12,
+                "size_y": 7,
+                "banner": false
+              }
+            ]
+          }
+        },
+        "fluidLayout": false
       },
       "isanon": false,
       "content": {
         "default": {
           "a": [
             {
-              "id": "ehng97cyk3kxogvi",
+              "id": "1icvhwkddx3p8gifyhmjpxpqfr",
               "content": {
                 "id": "Member_Status_Filter",
                 "title": "",
@@ -37,10 +62,10 @@
                   "url": "store://gadget/Member_Status_Filter/index.xml"
                 },
                 "styles": {
-                  "title": "",
-                  "height": "100",
+                  "height": "150",
                   "borders": false,
-                  "titlePosition": "left"
+                  "titlePosition": "left",
+                  "title": ""
                 },
                 "notify": {
                   "member-status-filter": {
@@ -52,18 +77,22 @@
                     "description": "This notifies cancellation of state 
selection"
                   }
                 },
+                "options": {},
+                "locale_titles": {
+                  "en-US": ""
+                },
                 "settings": {}
               }
             }
           ],
           "b": [
             {
-              "id": "q1pf6m8s5bq08uxr",
+              "id": "psipny83avcxvr5fi1dasv2t9",
               "content": {
                 "id": "Member_Count",
                 "title": "Member Count",
                 "type": "gadget",
-                "thumbnail": 
"local://store/carbon.super/gadget/usa-business-revenue/index.png",
+                "thumbnail": "local://images/gadgetIcon.png",
                 "data": {
                   "url": 
"local://store/carbon.super/gadget/Member_Count/index.xml"
                 },
@@ -73,7 +102,7 @@
                     "description": "Used to filter based on state",
                     "on": [
                       {
-                        "from": "ehng97cyk3kxogvi",
+                        "from": "1icvhwkddx3p8gifyhmjpxpqfr",
                         "event": "member-status-filter"
                       }
                     ]
@@ -85,10 +114,13 @@
                   }
                 },
                 "styles": {
-                  "title": "",
                   "height": "400",
                   "borders": true,
-                  "titlePosition": "left"
+                  "titlePosition": "left",
+                  "title": "Member Count"
+                },
+                "locale_titles": {
+                  "en-US": "Member Count"
                 },
                 "settings": {}
               }
@@ -96,7 +128,7 @@
           ],
           "c": [
             {
-              "id": "qf9lnn9oiv1pds4i",
+              "id": "2rq4foxv69spc286s1dx1rlik9",
               "content": {
                 "id": "Member_Update",
                 "title": "Member Status",
@@ -111,7 +143,7 @@
                     "description": "Used to filter based on state",
                     "on": [
                       {
-                        "from": "ehng97cyk3kxogvi",
+                        "from": "1icvhwkddx3p8gifyhmjpxpqfr",
                         "event": "member-status-filter"
                       }
                     ]
@@ -123,10 +155,13 @@
                   }
                 },
                 "styles": {
-                  "title": "",
                   "height": "800",
                   "borders": true,
-                  "titlePosition": "left"
+                  "titlePosition": "left",
+                  "title": "Member Status"
+                },
+                "locale_titles": {
+                  "en-US": "Member Status"
                 },
                 "settings": {}
               }
@@ -140,19 +175,36 @@
       "id": "member-details",
       "title": "Member Details",
       "layout": {
-        "id": "single-column",
-        "title": "Single Column",
-        "description": "This is a layout generated through single-column.io",
-        "thumbnail": "store://layout/single-column/index.png",
-        "url": "store://layout/single-column/index.hbs",
-        "content": "<!--\n\n Licensed to the Apache Software Foundation (ASF) 
under one\n or more contributor license agreements.  See the NOTICE file\n 
distributed with this work for additional information\n regarding copyright 
ownership.  The ASF licenses this file\n to you under the Apache License, 
Version 2.0 (the\n \"License\"); you may not use this file except in 
compliance\n with the License.  You may obtain a copy of the License at\n\n   
http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable 
law or agreed to in writing,\n software distributed under the License is 
distributed on an\n \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n 
KIND, either express or implied.  See the License for the\n specific language 
governing permissions and limitations\n under the License.\n\n-->\n<div 
class=\"container\">\n<div class=\"row\">\n    <div id=\"a\" class=\"col-md-12 
ues-component-box\"></div>\n    <div id=\"b\" class=\"col-md-12 
ues-component-box\"></div
 >\n    <div id=\"c\" class=\"col-md-12 
 >ues-component-box\"></div>\n</div>\n</div>\n"
+        "content": {
+          "loggedIn": {
+            "blocks": [
+              {
+                "id": "a",
+                "col": 1,
+                "row": 1,
+                "size_x": 12,
+                "size_y": 1,
+                "banner": false
+              },
+              {
+                "id": "b",
+                "col": 1,
+                "row": 2,
+                "size_x": 12,
+                "size_y": 9,
+                "banner": false
+              }
+            ]
+          }
+        },
+        "fluidLayout": false
       },
       "isanon": false,
       "content": {
         "default": {
           "a": [
             {
-              "id": "8zgl65uoackgldi",
+              "id": "rio4byw7i0qlqiygsdp1fw29",
               "content": {
                 "id": "Member_Details_Filter",
                 "title": "",
@@ -162,10 +214,10 @@
                   "url": "store://gadget/Member_Details_Filter/index.xml"
                 },
                 "styles": {
-                  "title": "",
                   "height": "100",
                   "borders": false,
-                  "titlePosition": "left"
+                  "titlePosition": "left",
+                  "title": ""
                 },
                 "notify": {
                   "member-details-filter": {
@@ -177,13 +229,17 @@
                   "type": "boolean",
                   "description": "This notifies cancellation of state 
selection"
                 },
+                "options": {},
+                "locale_titles": {
+                  "en-US": ""
+                },
                 "settings": {}
               }
             }
           ],
           "b": [
             {
-              "id": "hoqfz4b6z91nstt9",
+              "id": "31avp60ninmk9mno08eh2xogvi",
               "content": {
                 "id": "Member_Details",
                 "title": "Member Details",
@@ -198,7 +254,7 @@
                     "description": "Used to filter based on state",
                     "on": [
                       {
-                        "from": "8zgl65uoackgldi",
+                        "from": "rio4byw7i0qlqiygsdp1fw29",
                         "event": "member-details-filter"
                       }
                     ]
@@ -209,10 +265,13 @@
                   }
                 },
                 "styles": {
-                  "title": "",
-                  "height": "800",
+                  "height": "1200",
                   "borders": true,
-                  "titlePosition": "left"
+                  "titlePosition": "left",
+                  "title": "Member Details"
+                },
+                "locale_titles": {
+                  "en-US": "Member Details"
                 },
                 "settings": {}
               }
@@ -226,19 +285,36 @@
       "id": "tenant-metering",
       "title": "Tenant Metering",
       "layout": {
-        "id": "single-column",
-        "title": "Single Column",
-        "description": "This is a layout generated through single-column.io",
-        "thumbnail": "store://layout/single-column/index.png",
-        "url": "store://layout/single-column/index.hbs",
-        "content": "<div class=\"container\">\n<div class=\"row\">\n    <div 
id=\"a\" class=\"col-md-12 ues-component-box\"></div>\n    <div id=\"b\" 
class=\"col-md-12 ues-component-box\"></div>\n    <div id=\"c\" 
class=\"col-md-12 ues-component-box\"></div>\n</div>\n</div>\n"
+        "content": {
+          "loggedIn": {
+            "blocks": [
+              {
+                "id": "a",
+                "col": 1,
+                "row": 1,
+                "size_x": 12,
+                "size_y": 1,
+                "banner": false
+              },
+              {
+                "id": "b",
+                "col": 1,
+                "row": 2,
+                "size_x": 12,
+                "size_y": 7,
+                "banner": false
+              }
+            ]
+          }
+        },
+        "fluidLayout": false
       },
       "isanon": false,
       "content": {
         "default": {
           "a": [
             {
-              "id": "n0dcwgx88xe0zfr",
+              "id": "2p064k6c1rkcoy68zprzggmn29",
               "content": {
                 "id": "Application_Signups_Filter",
                 "title": "",
@@ -263,13 +339,17 @@
                   "type": "boolean",
                   "description": "This notifies cancellation of state 
selection"
                 },
+                "options": {},
+                "locale_titles": {
+                  "en-US": ""
+                },
                 "settings": {}
               }
             }
           ],
           "b": [
             {
-              "id": "2s1fvjnbib4t2o6r",
+              "id": "izak0xb74cpja530r4kg9zfr",
               "content": {
                 "id": "Application_Signups",
                 "title": "Tenant Metering",
@@ -284,7 +364,7 @@
                     "description": "Used to filter based on state",
                     "on": [
                       {
-                        "from": "n0dcwgx88xe0zfr",
+                        "from": "2p064k6c1rkcoy68zprzggmn29",
                         "event": "application-signups-filter"
                       }
                     ]
@@ -298,7 +378,10 @@
                   "height": "800",
                   "borders": true,
                   "titlePosition": "left",
-                  "title": "Application Signups"
+                  "title": "Tenant Metering"
+                },
+                "locale_titles": {
+                  "en-US": "Tenant Metering"
                 },
                 "settings": {}
               }
@@ -309,7 +392,15 @@
       }
     }
   ],
-  "landing": "member-status",
+  "identityServerUrl": "",
+  "accessTokenUrl": "",
+  "apiKey": "",
+  "apiSecret": "",
+  "banner": {
+    "globalBannerExists": null,
+    "customBannerExists": null
+  },
+  "landing": "landing",
   "isanon": false,
   "isUserCustom": false
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/ExecutionplanMemberCount/MemberCount.siddhiql
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/ExecutionplanMemberCount/MemberCount.siddhiql
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/ExecutionplanMemberCount/MemberCount.siddhiql
new file mode 100644
index 0000000..dfd3df9
--- /dev/null
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/ExecutionplanMemberCount/MemberCount.siddhiql
@@ -0,0 +1,42 @@
+/* Enter a unique ExecutionPlan */
+@Plan:name('MemberCount')
+
+/* Enter a unique description for ExecutionPlan */
+-- @Plan:description('ExecutionPlan')
+
+/* define streams/tables and write queries here ... */
+
+@Plan:trace('false')
+
+@Import('member_lifecycle:1.0.0')
+define stream member_lifecycle (timestamp long, application_id string, 
cluster_id string, cluster_alias string, cluster_instance_id string, 
service_name string, network_partition_id string, partition_id string, 
member_id string, member_status string);
+
+define stream temp_app_member_count (application_id string, active_instances 
long, member_status string);
+
+define stream temp_cluster_member_count (application_id string, cluster_alias 
string, active_instances long, member_status string);
+
+@From(eventtable='rdbms', 
datasource.name='WSO2_ANALYTICS_PROCESSED_DATA_STORE_DB', 
table.name='APP_ACTIVE_MEMBER_COUNT')
+define table APPLICATION_ACTIVE_MEMBER_COUNT (timestamp long, application_id 
string, active_instances long);
+
+@From(eventtable='rdbms', 
datasource.name='WSO2_ANALYTICS_PROCESSED_DATA_STORE_DB', 
table.name='CLUSTER_ACTIVE_MEMBER_COUNT')
+define table CLUSTER_ACTIVE_MEMBER_COUNT (timestamp long, application_id 
string, cluster_alias string, active_instances long);
+
+from member_lifecycle #window.unique(member_id)
+select application_id, count() as active_instances, member_status
+group by application_id, member_status
+having member_status == 'Active'
+insert all events into temp_app_member_count;
+
+from member_lifecycle #window.unique(member_id)
+select application_id, cluster_alias, count() as active_instances, 
member_status
+group by application_id, cluster_alias, member_status
+having member_status == 'Active'
+insert all events into temp_cluster_member_count;
+
+from temp_app_member_count [member_status=='Active']
+select time:timestampInMilliseconds() as timestamp, application_id, 
active_instances
+insert into APPLICATION_ACTIVE_MEMBER_COUNT;
+
+from temp_cluster_member_count [member_status=='Active']
+select time:timestampInMilliseconds() as timestamp, application_id, 
cluster_alias, active_instances
+insert into CLUSTER_ACTIVE_MEMBER_COUNT;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/ExecutionplanMemberCount/artifact.xml
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/ExecutionplanMemberCount/artifact.xml
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/ExecutionplanMemberCount/artifact.xml
new file mode 100644
index 0000000..aca2b7d
--- /dev/null
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/ExecutionplanMemberCount/artifact.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2005-2015 WSO2, Inc. (http://wso2.com)
+  ~
+  ~ 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.
+  -->
+<artifact name="ExecutionplanMemberCount" version="1.0.0" 
type="event/execution-plan" serverRole="DataAnalyticsServer">
+    <file>MemberCount.siddhiql</file>
+</artifact>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetApplicationSignUps/Application_Signups/js/main.js
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetApplicationSignUps/Application_Signups/js/main.js
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetApplicationSignUps/Application_Signups/js/main.js
index 228d8eb..90d2887 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetApplicationSignUps/Application_Signups/js/main.js
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetApplicationSignUps/Application_Signups/js/main.js
@@ -20,7 +20,7 @@
  */
 var type, columns, maxUpdateValue;
 
-var REFRESH_INTERVAL = 5000;
+var REFRESH_INTERVAL = 300000;
 var dataLoaded = true;
 var applicationId = '';
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/gadget.json
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/gadget.json
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/gadget.json
index 0960c82..ec1d0bc 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/gadget.json
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/gadget.json
@@ -2,7 +2,7 @@
   "id": "Member_Count",
   "title": "Member Count",
   "type": "gadget",
-  "thumbnail": 
"local://store/carbon.super/gadget/usa-business-revenue/index.png",
+  "thumbnail": "local://images/gadgetIcon.png",
   "data": {
     "url": "local://store/carbon.super/gadget/Member_Count/index.xml"
   },

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/index.xml
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/index.xml
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/index.xml
index a743efe..5c72dda 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/index.xml
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/index.xml
@@ -42,7 +42,10 @@
               display_name="Data Source"
               
default_value="/portal/gadgets/bar-chart/datasource/dataFile4.jag">
     </UserPref>
-
+    <!--UserPref name="options"
+              display_name="Chart Options"
+              default_value="/portal/gadgets/bar-chart/js/options-bar.js">
+    </UserPref-->
     <UserPref name="updateGraph"
               display_name="Update Interval (s)"
               default_value="No">

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/d3.geomap.dependencies.min.js
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/d3.geomap.dependencies.min.js
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/d3.geomap.dependencies.min.js
index 67087a6..d151d95 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/d3.geomap.dependencies.min.js
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/d3.geomap.dependencies.min.js
@@ -23,7 +23,7 @@
         return n && (n.ownerDocument || n.document || n).documentElement
     }
 
-    function t( n) {
+    function t(n) {
         return n && (n.ownerDocument && n.ownerDocument.defaultView || 
n.document && n || n.defaultView)
     }
 
@@ -83,11 +83,11 @@
     }
 
     function h(n) {
-        return s(n)in this._
+        return s(n) in this._
     }
 
     function g(n) {
-        return (n = s(n))in this._ && delete this._[n]
+        return (n = s(n)) in this._ && delete this._[n]
     }
 
     function p() {
@@ -387,7 +387,7 @@
 
     function W(e) {
         var r = ".dragsuppress-" + ++Aa, u = "click" + r, i = 
ta.select(t(e)).on("touchmove" + r, S).on("dragstart" + r, S).on("selectstart" 
+ r, S);
-        if (null == Ea && (Ea = "onselectstart"in e ? !1 : x(e.style, 
"userSelect")), Ea) {
+        if (null == Ea && (Ea = "onselectstart" in e ? !1 : x(e.style, 
"userSelect")), Ea) {
             var o = n(e).style, a = o[Ea];
             o[Ea] = "none"
         }
@@ -591,7 +591,7 @@
         }
 
         var i = {}, o = ta.dispatch("beforesend", "progress", "load", 
"error"), a = {}, c = new XMLHttpRequest, l = null;
-        return !this.XDomainRequest || "withCredentials"in c || 
!/^(http(s)?:)?\/\//.test(n) || (c = new XDomainRequest), "onload"in c ? 
c.onload = c.onerror = u : c.onreadystatechange = function () {
+        return !this.XDomainRequest || "withCredentials" in c || 
!/^(http(s)?:)?\/\//.test(n) || (c = new XDomainRequest), "onload" in c ? 
c.onload = c.onerror = u : c.onreadystatechange = function () {
             c.readyState > 3 && u()
         }, c.onprogress = function (n) {
             var t = ta.event;
@@ -614,7 +614,7 @@
                 return i.send.apply(i, [n].concat(ra(arguments)))
             }
         }), i.send = function (e, r, u) {
-            if (2 === arguments.length && "function" == typeof r && (u = r, r 
= null), c.open(e, n, !0), null == t || "accept"in a || (a.accept = t + 
",*/*"), c.setRequestHeader)for (var s in a)c.setRequestHeader(s, a[s]);
+            if (2 === arguments.length && "function" == typeof r && (u = r, r 
= null), c.open(e, n, !0), null == t || "accept" in a || (a.accept = t + 
",*/*"), c.setRequestHeader)for (var s in a)c.setRequestHeader(s, a[s]);
             return null != t && c.overrideMimeType && c.overrideMimeType(t), 
null != l && (c.responseType = l), null != u && i.on("error", u).on("load", 
function (n) {
                 u(null, n)
             }), o.beforesend.call(i, c), c.send(null == r ? null : r), i
@@ -784,9 +784,9 @@
             return t.parse = function (t) {
                 var r = {y: 1900, m: 0, d: 1, H: 0, M: 0, S: 0, L: 0, Z: 
null}, u = e(r, n, t, 0);
                 if (u != t.length)return null;
-                "p"in r && (r.H = r.H % 12 + 12 * r.p);
+                "p" in r && (r.H = r.H % 12 + 12 * r.p);
                 var i = null != r.Z && cc !== jt, o = new (i ? jt : cc);
-                return "j"in r ? o.setFullYear(r.y, 0, r.j) : "w"in r && 
("W"in r || "U"in r) ? (o.setFullYear(r.y, 0, 1), o.setFullYear(r.y, 0, "W"in r 
? (r.w + 6) % 7 + 7 * r.W - (o.getDay() + 5) % 7 : r.w + 7 * r.U - (o.getDay() 
+ 6) % 7)) : o.setFullYear(r.y, r.m, r.d), o.setHours(r.H + (r.Z / 100 | 0), 
r.M + r.Z % 100, r.S, r.L), i ? o._ : o
+                return "j" in r ? o.setFullYear(r.y, 0, r.j) : "w" in r && 
("W" in r || "U" in r) ? (o.setFullYear(r.y, 0, 1), o.setFullYear(r.y, 0, "W" 
in r ? (r.w + 6) % 7 + 7 * r.W - (o.getDay() + 5) % 7 : r.w + 7 * r.U - 
(o.getDay() + 6) % 7)) : o.setFullYear(r.y, r.m, r.d), o.setHours(r.H + (r.Z / 
100 | 0), r.M + r.Z % 100, r.S, r.L), i ? o._ : o
             }, t.toString = function () {
                 return n
             }, t
@@ -3730,7 +3730,7 @@
         n = N(n);
         for (var o = -1, a = this.length; ++o < a;) {
             i.push(t = []), t.parentNode = (r = this[o]).parentNode;
-            for (var c = -1, l = r.length; ++c < l;)(u = r[c]) ? (t.push(e = 
n.call(u, u.__data__, c, o)), e && "__data__"in u && (e.__data__ = u.__data__)) 
: t.push(null)
+            for (var c = -1, l = r.length; ++c < l;)(u = r[c]) ? (t.push(e = 
n.call(u, u.__data__, c, o)), e && "__data__" in u && (e.__data__ = 
u.__data__)) : t.push(null)
         }
         return A(i)
     }, _a.selectAll = function (n) {
@@ -4112,9 +4112,9 @@
             y: 0,
             k: 1
         }, A = [960, 500], N = Ia, C = 250, z = 0, q = "mousedown.zoom", L = 
"mousemove.zoom", T = "mouseup.zoom", R = "touchstart.zoom", D = E(n, 
"zoomstart", "zoom", "zoomend");
-        return Oa || (Oa = "onwheel"in ua ? (Ha = function () {
+        return Oa || (Oa = "onwheel" in ua ? (Ha = function () {
             return -ta.event.deltaY * (ta.event.deltaMode ? 120 : 1)
-        }, "wheel") : "onmousewheel"in ua ? (Ha = function () {
+        }, "wheel") : "onmousewheel" in ua ? (Ha = function () {
             return ta.event.wheelDelta
         }, "mousewheel") : (Ha = function () {
             return -ta.event.detail
@@ -5945,7 +5945,7 @@
         n = N(n);
         for (var a = -1, c = this.length; ++a < c;) {
             o.push(t = []);
-            for (var l = this[a], s = -1, f = l.length; ++s < f;)(r = l[s]) && 
(e = n.call(r, r.__data__, s, a)) ? ("__data__"in r && (e.__data__ = 
r.__data__), $o(e, s, i, u, r[i][u]), t.push(e)) : t.push(null)
+            for (var l = this[a], s = -1, f = l.length; ++s < f;)(r = l[s]) && 
(e = n.call(r, r.__data__, s, a)) ? ("__data__" in r && (e.__data__ = 
r.__data__), $o(e, s, i, u, r[i][u]), t.push(e)) : t.push(null)
         }
         return Yo(o, i, u)
     }, Pl.selectAll = function (n) {

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/d3.geomap.min.js
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/d3.geomap.min.js
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/d3.geomap.min.js
index 45f87a0..d8e92d2 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/d3.geomap.min.js
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/d3.geomap.min.js
@@ -381,7 +381,7 @@ var colorbrewer = {
     function f(f, e) {
         for (var d = 0; d < e.length; d++) {
             var c = e[d];
-            c.enumerable = c.enumerable || !1, c.configurable = !0, "value"in 
c && (c.writable = !0), Object.defineProperty(f, c.key, c)
+            c.enumerable = c.enumerable || !1, c.configurable = !0, "value" in 
c && (c.writable = !0), Object.defineProperty(f, c.key, c)
         }
     }
 
@@ -445,7 +445,7 @@ var _createClass = function () {
     function f(f, e) {
         for (var d = 0; d < e.length; d++) {
             var c = e[d];
-            c.enumerable = c.enumerable || !1, c.configurable = !0, "value"in 
c && (c.writable = !0), Object.defineProperty(f, c.key, c)
+            c.enumerable = c.enumerable || !1, c.configurable = !0, "value" in 
c && (c.writable = !0), Object.defineProperty(f, c.key, c)
         }
     }
 
@@ -458,7 +458,7 @@ var _createClass = function () {
         r = i = n = void 0, c = !1;
         var r = Object.getOwnPropertyDescriptor(a, b);
         if (void 0 !== r) {
-            if ("value"in r)return r.value;
+            if ("value" in r)return r.value;
             var n = r.get;
             return void 0 === n ? void 0 : n.call(t)
         }

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/d3.min.js
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/d3.min.js
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/d3.min.js
index 0444ec4..75e8662 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/d3.min.js
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/d3.min.js
@@ -75,11 +75,11 @@
     }
 
     function s(n) {
-        return c(n)in this._
+        return c(n) in this._
     }
 
     function f(n) {
-        return (n = c(n))in this._ && delete this._[n]
+        return (n = c(n)) in this._ && delete this._[n]
     }
 
     function h() {
@@ -583,7 +583,7 @@
         }
 
         var i = {}, o = ta.dispatch("beforesend", "progress", "load", 
"error"), a = {}, c = new XMLHttpRequest, l = null;
-        return !oa.XDomainRequest || "withCredentials"in c || 
!/^(http(s)?:)?\/\//.test(n) || (c = new XDomainRequest), "onload"in c ? 
c.onload = c.onerror = u : c.onreadystatechange = function () {
+        return !oa.XDomainRequest || "withCredentials" in c || 
!/^(http(s)?:)?\/\//.test(n) || (c = new XDomainRequest), "onload" in c ? 
c.onload = c.onerror = u : c.onreadystatechange = function () {
             c.readyState > 3 && u()
         }, c.onprogress = function (n) {
             var t = ta.event;
@@ -606,7 +606,7 @@
                 return i.send.apply(i, [n].concat(ra(arguments)))
             }
         }), i.send = function (e, r, u) {
-            if (2 === arguments.length && "function" == typeof r && (u = r, r 
= null), c.open(e, n, !0), null == t || "accept"in a || (a.accept = t + 
",*/*"), c.setRequestHeader)for (var s in a)c.setRequestHeader(s, a[s]);
+            if (2 === arguments.length && "function" == typeof r && (u = r, r 
= null), c.open(e, n, !0), null == t || "accept" in a || (a.accept = t + 
",*/*"), c.setRequestHeader)for (var s in a)c.setRequestHeader(s, a[s]);
             return null != t && c.overrideMimeType && c.overrideMimeType(t), 
null != l && (c.responseType = l), null != u && i.on("error", u).on("load", 
function (n) {
                 u(null, n)
             }), o.beforesend.call(i, c), c.send(null == r ? null : r), i
@@ -776,9 +776,9 @@
             return t.parse = function (t) {
                 var r = {y: 1900, m: 0, d: 1, H: 0, M: 0, S: 0, L: 0, Z: 
null}, u = e(r, n, t, 0);
                 if (u != t.length)return null;
-                "p"in r && (r.H = r.H % 12 + 12 * r.p);
+                "p" in r && (r.H = r.H % 12 + 12 * r.p);
                 var i = null != r.Z && hc !== jt, o = new (i ? jt : hc);
-                return "j"in r ? o.setFullYear(r.y, 0, r.j) : "w"in r && 
("W"in r || "U"in r) ? (o.setFullYear(r.y, 0, 1), o.setFullYear(r.y, 0, "W"in r 
? (r.w + 6) % 7 + 7 * r.W - (o.getDay() + 5) % 7 : r.w + 7 * r.U - (o.getDay() 
+ 6) % 7)) : o.setFullYear(r.y, r.m, r.d), o.setHours(r.H + (0 | r.Z / 100), 
r.M + r.Z % 100, r.S, r.L), i ? o._ : o
+                return "j" in r ? o.setFullYear(r.y, 0, r.j) : "w" in r && 
("W" in r || "U" in r) ? (o.setFullYear(r.y, 0, 1), o.setFullYear(r.y, 0, "W" 
in r ? (r.w + 6) % 7 + 7 * r.W - (o.getDay() + 5) % 7 : r.w + 7 * r.U - 
(o.getDay() + 6) % 7)) : o.setFullYear(r.y, r.m, r.d), o.setHours(r.H + (0 | 
r.Z / 100), r.M + r.Z % 100, r.S, r.L), i ? o._ : o
             }, t.toString = function () {
                 return n
             }, t
@@ -3725,7 +3725,7 @@
         n = k(n);
         for (var o = -1, a = this.length; ++o < a;) {
             i.push(t = []), t.parentNode = (r = this[o]).parentNode;
-            for (var c = -1, l = r.length; ++c < l;)(u = r[c]) ? (t.push(e = 
n.call(u, u.__data__, c, o)), e && "__data__"in u && (e.__data__ = u.__data__)) 
: t.push(null)
+            for (var c = -1, l = r.length; ++c < l;)(u = r[c]) ? (t.push(e = 
n.call(u, u.__data__, c, o)), e && "__data__" in u && (e.__data__ = 
u.__data__)) : t.push(null)
         }
         return S(i)
     }, ka.selectAll = function (n) {
@@ -3919,7 +3919,7 @@
     Ca.forEach(function (n) {
         "on" + n in ua && Ca.remove(n)
     });
-    var za = "onselectstart"in ua ? null : m(ia.style, "userSelect"), qa = 0;
+    var za = "onselectstart" in ua ? null : m(ia.style, "userSelect"), qa = 0;
     ta.mouse = function (n) {
         return $(n, _())
     };
@@ -4141,9 +4141,9 @@
             return arguments.length ? (S = t, _ = t.copy(), k = {x: 0, y: 0, 
k: 1}, n) : S
         }, ta.rebind(n, R, "on")
     };
-    var Za, Va = [0, 1 / 0], Xa = "onwheel"in ua ? (Za = function () {
+    var Za, Va = [0, 1 / 0], Xa = "onwheel" in ua ? (Za = function () {
         return -ta.event.deltaY * (ta.event.deltaMode ? 120 : 1)
-    }, "wheel") : "onmousewheel"in ua ? (Za = function () {
+    }, "wheel") : "onmousewheel" in ua ? (Za = function () {
         return ta.event.wheelDelta
     }, "mousewheel") : (Za = function () {
         return -ta.event.detail
@@ -5938,7 +5938,7 @@
         n = k(n);
         for (var a = -1, c = this.length; ++a < c;) {
             o.push(t = []);
-            for (var l = this[a], s = -1, f = l.length; ++s < f;)(r = l[s]) && 
(e = n.call(r, r.__data__, s, a)) ? ("__data__"in r && (e.__data__ = 
r.__data__), $o(e, s, i, u, r[i][u]), t.push(e)) : t.push(null)
+            for (var l = this[a], s = -1, f = l.length; ++s < f;)(r = l[s]) && 
(e = n.call(r, r.__data__, s, a)) ? ("__data__" in r && (e.__data__ = 
r.__data__), $o(e, s, i, u, r[i][u]), t.push(e)) : t.push(null)
         }
         return Io(o, i, u)
     }, Hl.selectAll = function (n) {

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/gadgetconf.js
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/gadgetconf.js
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/gadgetconf.js
index 503e038..20e6188 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/gadgetconf.js
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/gadgetconf.js
@@ -20,7 +20,8 @@
  */
 var gadgetConfig = {
     "id": "Member_Count",
-    "title": "Member_Count",
+    "title": "Member Count",
+    "datasource": "ACTIVE_MEMBER_COUNT",
     "type": "batch",
     "columns": [
         {
@@ -28,26 +29,14 @@ var gadgetConfig = {
             "DATA_TYPE": "varchar"
         },
         {
-            "COLUMN_NAME": "CreatedInstanceCount",
-            "DATA_TYPE": "int"
-        },
-        {
-            "COLUMN_NAME": "InitializedInstanceCount",
-            "DATA_TYPE": "int"
-        },
-        {
-            "COLUMN_NAME": "ActiveInstanceCount",
-            "DATA_TYPE": "int"
-        },
-        {
-            "COLUMN_NAME": "TerminatedInstanceCount",
-            "DATA_TYPE": "int"
+            "COLUMN_NAME": "ActiveInstances",
+            "DATA_TYPE": "LONG"
         }
     ],
     "maxUpdateValue": 10,
     "chartConfig": {
         "chartType": "line",
-        "yAxis": [1, 2, 3, 4],
+        "yAxis": [1],
         "xAxis": 0,
         "interpolationMode": "line"
     },

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/igviz.js
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/igviz.js
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/igviz.js
index 671358b..fc90f40 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/igviz.js
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/igviz.js
@@ -78,7 +78,6 @@
         divId = chartObj.canvas;
         chartConfig = chartObj.config;
         dataTable = chartObj.dataTable;
-        // table=setData(dataTable,chartConfig)
 
         xString = "data." + 
createAttributeNames(dataTable.metadata.names[chartConfig.xAxis])
         yStrings = [];
@@ -87,6 +86,11 @@
 
         }
 
+        //When there are multiple values for Y axis, it cannot started by 
minimum value
+        var zeroConfig = false;
+        if (yStrings.length > 1) {
+            zeroConfig = true;
+        }
 
         xScaleConfig = {
             "index": chartConfig.xAxis,
@@ -104,6 +108,7 @@
             "schema": dataTable.metadata,
             "name": "y",
             "range": "height",
+            "zero": zeroConfig,
             "nice": true,
             "field": yStrings[0]
         }
@@ -114,7 +119,6 @@
                 yDomain.push(row[columnIndex]);
             });
         });
-
         yDomain.sort(function (a, b) {
             return a - b;
         });
@@ -134,7 +138,7 @@
             "type": "x",
             "scale": "x",
             "angle": -35,
-            "title": dataTable.metadata.names[chartConfig.xAxis],
+            "title": "Time",
             "grid": true,
             "dx": -10,
             "dy": 10,
@@ -264,7 +268,7 @@
         chartObj.toolTipFunction = [];
         chartObj.toolTipFunction[0] = function (event, item) {
 
-            console.log(tool, event, item);
+            //console.log(tool,event,item);
             if (item.mark.marktype == 'symbol') {
                 xVar = dataTable.metadata.names[chartConfig.xAxis]
                 yVar = dataTable.metadata.names[chartConfig.yAxis]
@@ -289,8 +293,6 @@
 
         chartObj.spec = spec;
         chartObj.toolTip = true;
-        chartObj.spec = spec;
-
     }
 
 
@@ -307,9 +309,9 @@
 
             }
             if (format == "grouped") {
-                console.log("groupedDFJSDFKSD:JFKDJF");
+                //console.log("groupedDFJSDFKSD:JFKDJF");
                 if (chartConfig.orientation == 'H') {
-                    console.log('horizontal');
+                    //console.log('horizontal');
                     return this.drawGroupedBarChart(mychart);
 
                 }
@@ -338,6 +340,7 @@
             "schema": dataTable.metadata,
             "name": "y",
             "range": "height",
+            "zero": true,
             "nice": true,
             "field": yString
         }
@@ -1026,6 +1029,7 @@
             "schema": dataTable.metadata,
             "name": "y",
             "range": "height",
+            "zero": true,
             "field": yStrings
         }
 
@@ -1468,6 +1472,7 @@
             "name": "val",
             "range": "height",
             "dataFrom": "stats",
+            "zero": true,
             "field": "sum",
             "nice": true
         }
@@ -1923,6 +1928,7 @@
             "schema": dataTable.metadata,
             "name": "y",
             "range": "height",
+            "zero": false,
             "nice": true,
             "field": yString
         }
@@ -2066,7 +2072,7 @@
         }
         chartObj.toolTipFunction = [];
         chartObj.toolTipFunction[0] = function (event, item) {
-            console.log(tool, event, item);
+            //console.log(tool,event,item);
             xVar = dataTable.metadata.names[chartConfig.xAxis]
             yVar = dataTable.metadata.names[chartConfig.yAxis]
             pSize = dataTable.metadata.names[chartConfig.pointSize]
@@ -2294,9 +2300,9 @@
             }
             if (isFound) {
                 tempData[j][1] += currentYvalue;
-                console.log(name, currentYvalue, tempData[j][1]);
+                //console.log(name, currentYvalue, tempData[j][1]);
             } else {
-                console.log("create", name, currentYvalue);
+                //console.log("create", name, currentYvalue);
                 tempData.push([name, currentYvalue])
             }
         }
@@ -2322,7 +2328,7 @@
 
                 filtersList = filters.data();
 
-                console.log(filtersList)
+                //console.log(filtersList)
                 var filterdDataset = [];
                 var selectionObj = JSON.parse(JSON.stringify(originaltable));
                 itr = 0;
@@ -2357,7 +2363,7 @@
 
 
             if (index < chartConfig.xAxis.length) {
-                console.log(x);
+                //console.log(x);
                 d3.select(x.chart._el).selectAll('g.type-rect 
rect').on('click', function (d, i) {
                     // console.log(d, i, this);
                     console.log(d, i);
@@ -2409,7 +2415,7 @@
     function setScale(scaleConfig) {
         var scale = {"name": scaleConfig.name};
 
-        console.log(scaleConfig.schema, scaleConfig.index);
+        //console.log(scaleConfig.schema,scaleConfig.index);
 
         dataFrom = "table";
 
@@ -2473,14 +2479,13 @@
         if (scaleConfig.hasOwnProperty("zero")) {
             scale["zero"] = scaleConfig.zero;
         }
-        console.log(scale);
         return scale;
 
     }
 
     function setAxis(axisConfig) {
 
-        console.log("Axis", axisConfig);
+        //console.log("Axis",axisConfig);
 
         axis = {
             "type": axisConfig.type,
@@ -2528,7 +2533,7 @@
             axis["tickPadding"] = axisConfig.tickPadding;
         }
 
-        console.log("SpecAxis", axis);
+        //console.log("SpecAxis",axis);
         return axis;
     }
 
@@ -2545,8 +2550,11 @@
             for (j = 0; j < namesArray.length; j++) {
                 if (schema.types[j] == 'T') {
                     ptObj[createAttributeNames(namesArray[j])] = new 
Date(dataTableObj[i][j]);
-                } else
+                } else if (schema.types[j] == 'N') {
+                    ptObj[createAttributeNames(namesArray[j])] = 
parseFloat(dataTableObj[i][j]);
+                } else {
                     ptObj[createAttributeNames(namesArray[j])] = 
dataTableObj[i][j];
+                }
             }
 
             table[i] = ptObj;
@@ -2587,7 +2595,7 @@
         MappingObj["tickWidth"] = "ticks.strokeWidth";
 
 
-        console.log("previous Axis", spec)
+        //console.log("previous Axis",spec)
         for (var propt in axisConfig) {
 
             if (propt == "tickSize" || propt == "tickPadding")
@@ -2608,7 +2616,7 @@
             }
         }
 
-        console.log("NEW SPEC", spec);
+        //console.log("NEW SPEC",spec);
     }
 
     function createScales(dataset, chartConfig, dataTable) {
@@ -2853,7 +2861,7 @@
     };
 
     igviz.DataTable.prototype.toJSON = function () {
-        console.log(this);
+        //console.log(this);
     };
 
 
@@ -3005,7 +3013,7 @@
     }
 
     Chart.prototype.update = function (pointObj) {
-        console.log("+++ Inside update");
+        //console.log("+++ Inside update");
 
         if (this.config.chartType == "map") {
             config = this.config;
@@ -3032,7 +3040,7 @@
                 this.dataTable.data.push(pointObj);
                 this.table.push(newTable[0]);
 
-                if (this.config.chartType == "tabular" || 
this.config.chartType == "singleNumber") {
+                if (this.config.chartType == "tabular" || 
this.config.chartType == "singleNumber" || this.config.chartType == "bar") {
                     this.plot(persistedData, maxValueForUpdate);
                 } else {
                     this.chart.data(this.data).update({"duration": 500});
@@ -3045,7 +3053,7 @@
     }
 
     Chart.prototype.updateList = function (dataList, callback) {
-        console.log("+++ Inside updateList");
+        //console.log("+++ Inside updateList");
 
         for (i = 0; i < dataList.length; i++) {
             this.dataTable.data.shift();
@@ -3059,7 +3067,7 @@
             this.table.push(newTable[i]);
         }
 
-        //     console.log(point,this.chart,this.data);
+        //     //console.log(point,this.chart,this.data);
         this.chart.data(this.data).update();
 
     }
@@ -3068,7 +3076,7 @@
         var ref = this;
         var newH = document.getElementById(ref.canvas.replace('#', 
'')).offsetHeight
         var newW = document.getElementById(ref.canvas.replace('#', 
'')).offsetWidth
-        console.log("Resized", newH, newW, ref)
+        //console.log("Resized",newH,newW,ref)
 
         var left = 0, top = 0, right = 0, bottom = 0;
 
@@ -3103,7 +3111,7 @@
         //    h=newH-top-bottom;
         //
         //}
-        console.log(w, h);
+        //console.log(w,h);
         ref.chart.width(w).height(h).renderer('svg').update({props: 
'enter'}).update();
 
     }
@@ -3364,7 +3372,7 @@
 
             var colorRows = d3.scale.linear()
                 .domain([2.5, 4])
-                .range(['#F5BFE8', '#E305AF']);
+                .range(['#EFF5FA', '#5D9DC9']);
 
             var fontSize = d3.scale.linear()
                 .domain([0, 100])
@@ -3395,8 +3403,8 @@
                     .append("td");
 
                 cells.text(function (d, i) {
-                    return d;
-                })
+                        return d;
+                    })
                     .style("font-size", function (d, i) {
                         fontSize.domain([
                             d3.min(parseColumnFrom2DArray(tableData, i)),
@@ -3428,8 +3436,8 @@
                     .append("td");
 
                 cells.text(function (d, i) {
-                    return d;
-                })
+                        return d;
+                    })
                     .style('background-color', function (d, i) {
 
                         //This is where the color is decided for the cell
@@ -3458,8 +3466,8 @@
                     .append("td");
 
                 cells.text(function (d, i) {
-                    return d;
-                })
+                        return d;
+                    })
                     .style("font-size", function (d, i) {
                         fontSize.domain([
                             d3.min(parseColumnFrom2DArray(tableData, i)),
@@ -3472,12 +3480,12 @@
                 //appending the rows inside the table body
                 rows.style('background-color', function (d, i) {
 
-                    colorRows.domain([
-                        d3.min(parseColumnFrom2DArray(tableData, 
config.xAxis)),
-                        d3.max(parseColumnFrom2DArray(tableData, config.xAxis))
-                    ]);
-                    return colorRows(d[config.xAxis]);
-                })
+                        colorRows.domain([
+                            d3.min(parseColumnFrom2DArray(tableData, 
config.xAxis)),
+                            d3.max(parseColumnFrom2DArray(tableData, 
config.xAxis))
+                        ]);
+                        return colorRows(d[config.xAxis]);
+                    })
                     .style("font-size", function (d, i) {
 
                         fontSize.domain([
@@ -3575,7 +3583,7 @@
                     callback.call(ref);
                 }
             });
-            console.log(this);
+            //console.log(this);
         }
 
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/jquery.js
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/jquery.js
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/jquery.js
index d332fe2..03c2242 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/jquery.js
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/jquery.js
@@ -1126,18 +1126,18 @@
                                     fn = fns[i];
                                 // deferred[ done | fail | progress ] for 
forwarding actions to newDefer
                                 deferred[tuple[1]](jQuery.isFunction(fn) ?
-                                        function () {
-                                            var returned = fn.apply(this, 
arguments);
-                                            if (returned && 
jQuery.isFunction(returned.promise)) {
-                                                returned.promise()
-                                                    .done(newDefer.resolve)
-                                                    .fail(newDefer.reject)
-                                                    .progress(newDefer.notify);
-                                            } else {
-                                                newDefer[action + "With"](this 
=== deferred ? newDefer : this, [returned]);
-                                            }
-                                        } :
-                                        newDefer[action]
+                                    function () {
+                                        var returned = fn.apply(this, 
arguments);
+                                        if (returned && 
jQuery.isFunction(returned.promise)) {
+                                            returned.promise()
+                                                .done(newDefer.resolve)
+                                                .fail(newDefer.reject)
+                                                .progress(newDefer.notify);
+                                        } else {
+                                            newDefer[action + "With"](this === 
deferred ? newDefer : this, [returned]);
+                                        }
+                                    } :
+                                    newDefer[action]
                                 );
                             });
                             fns = null;
@@ -5502,7 +5502,7 @@
 
         addBack: function (selector) {
             return this.add(selector == null ?
-                    this.prevObject : this.prevObject.filter(selector)
+                this.prevObject : this.prevObject.filter(selector)
             );
         }
     });
@@ -7062,12 +7062,12 @@
 
             set: function (elem, value, extra) {
                 return setPositiveNumber(elem, value, extra ?
-                        augmentWidthOrHeight(
-                            elem,
-                            name,
-                            extra,
-                            jQuery.support.boxSizing && jQuery.css(elem, 
"boxSizing") === "border-box"
-                        ) : 0
+                    augmentWidthOrHeight(
+                        elem,
+                        name,
+                        extra,
+                        jQuery.support.boxSizing && jQuery.css(elem, 
"boxSizing") === "border-box"
+                    ) : 0
                 );
             }
         };
@@ -7200,8 +7200,8 @@
         },
         serializeArray: function () {
             return this.map(function () {
-                return this.elements ? jQuery.makeArray(this.elements) : this;
-            })
+                    return this.elements ? jQuery.makeArray(this.elements) : 
this;
+                })
                 .filter(function () {
                     return this.name && !this.disabled &&
                         ( this.checked || rselectTextarea.test(this.nodeName) 
||
@@ -7490,8 +7490,8 @@
                 // Create a dummy div to hold the results
                 jQuery("<div>")
 
-                    // inject the contents of the document in, removing the 
scripts
-                    // to avoid any 'Permission Denied' errors in IE
+                // inject the contents of the document in, removing the scripts
+                // to avoid any 'Permission Denied' errors in IE
                     .append(responseText.replace(rscript, ""))
 
                     // Locate the specified elements

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/main.js
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/main.js
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/main.js
index 3c43aae..63771ba 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/main.js
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/main.js
@@ -20,7 +20,7 @@
  */
 var type, columns, maxUpdateValue;
 
-var REFRESH_INTERVAL = 5000;
+var REFRESH_INTERVAL = 300000;
 var dataLoaded = true;
 var timeInterval = '30 Min';
 var applicationId = '';
@@ -121,7 +121,11 @@ function makeRows(data) {
     var rows = [];
     for (var i = 0; i < data.length; i++) {
         var record = data[i];
+        var format = d3.time.format("%Y-%m-%d %H:%M:%S");
         var row = columns.map(function (column) {
+            if (column.COLUMN_NAME == 'Time') {
+                 record[column.COLUMN_NAME]=format(new 
Date(parseInt(record[column.COLUMN_NAME])));
+            }
             return record[column.COLUMN_NAME];
         });
         rows.push(row);
@@ -150,12 +154,12 @@ function drawChart(data) {
         } else {
             chart = igviz.setUp("#placeholder", gadgetConfig.chartConfig, 
dataTable);
             chart.setXAxis({
-                "labelAngle": -35,
-                "labelAlign": "right",
-                "labelDy": 0,
-                "labelDx": 0,
-                "titleDy": 25
-            })
+                    "labelAngle": -35,
+                    "labelAlign": "right",
+                    "labelDy": 0,
+                    "labelDx": 0,
+                    "titleDy": 25
+                })
                 .setYAxis({
                     "titleDy": -30
                 });

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/vega.js
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/vega.js
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/vega.js
index cd6eb78..927ecb4 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/vega.js
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberCount/Member_Count/js/vega.js
@@ -22,10 +22,10 @@
 // https://github.com/umdjs/umd/blob/master/amdWeb.js
 
 (function (factory) {
-    if (typeof define === 'function' && define.amd) {
+    if (typeof defineMember_Count === 'function' && define.amd) {
         // Support AMD. Register as an anonymous module.
         // NOTE: List all dependencies in AMD style
-        define(['d3.min', 'topojson'], factory);
+        define(['d3', 'topojson'], factory);
     } else {
         // No AMD. Set module as a global variable
         // NOTE: Pass dependencies to factory function
@@ -2753,8 +2753,8 @@
                     stop.enter().append("stop");
                     stop.exit().remove();
                     stop.attr("offset", function (d) {
-                        return d.offset;
-                    })
+                            return d.offset;
+                        })
                         .attr("stop-color", function (d) {
                             return d.color;
                         });
@@ -4300,9 +4300,9 @@
         };
         vg.data.treemap = function () {
             var layout = d3.layout.treemap()
-                    .children(function (d) {
-                        return d.values;
-                    }),
+                .children(function (d) {
+                    return d.values;
+                }),
                 value = vg.accessor("data"),
                 size = ["width", "height"],
                 params = ["round", "sticky", "ratio", "padding"],
@@ -4879,9 +4879,9 @@
 
             function legend(def, index, legend, scales) {
                 // legend scales
-                legend.size(def.size ? scales[def.size] : null);
-                legend.shape(def.shape ? scales[def.shape] : null);
-                legend.fill(def.fill ? scales[def.fill] : null);
+                legend.size  (def.size ? scales[def.size] : null);
+                legend.shape (def.shape ? scales[def.shape] : null);
+                legend.fill  (def.fill ? scales[def.fill] : null);
                 legend.stroke(def.stroke ? scales[def.stroke] : null);
 
                 // legend orientation
@@ -6010,7 +6010,7 @@
                         item.status = UPDATE;
                     }
 
-                    // update set      
+                    // update set
                     if (item.status !== EXIT && update) {
                         update.call(vg, item, group, trans);
                     }
@@ -7623,10 +7623,10 @@
 
                 if (opt.hover !== false) {
                     v.on("mouseover", function (evt, item) {
-                        if (item.hasPropertySet("hover")) {
-                            this.update({props: "hover", items: item});
-                        }
-                    })
+                            if (item.hasPropertySet("hover")) {
+                                this.update({props: "hover", items: item});
+                            }
+                        })
                         .on("mouseout", function (evt, item) {
                             if (item.hasPropertySet("hover")) {
                                 this.update({props: "update", items: item});

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberInformation/Member_Information/js/main.js
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberInformation/Member_Information/js/main.js
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberInformation/Member_Information/js/main.js
index e63d14c..c5b60d6 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberInformation/Member_Information/js/main.js
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberInformation/Member_Information/js/main.js
@@ -20,7 +20,7 @@
  */
 var type, columns, maxUpdateValue;
 
-var REFRESH_INTERVAL = 5000;
+var REFRESH_INTERVAL = 300000;
 var dataLoaded = true;
 
 var applicationId = '';

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberStatus/Member_Status/js/main.js
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberStatus/Member_Status/js/main.js
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberStatus/Member_Status/js/main.js
index 3a8b60e..093c1a6 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberStatus/Member_Status/js/main.js
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberStatus/Member_Status/js/main.js
@@ -20,7 +20,7 @@
  */
 var type, columns, maxUpdateValue;
 
-var REFRESH_INTERVAL = 5000;
+var REFRESH_INTERVAL = 300000;
 var dataLoaded = true;
 
 var timeInterval = '30 Min';

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberStatusFilter/Member_Status_Filter/index.xml
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberStatusFilter/Member_Status_Filter/index.xml
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberStatusFilter/Member_Status_Filter/index.xml
index 3300e3d..3d4d228 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberStatusFilter/Member_Status_Filter/index.xml
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/GadgetMemberStatusFilter/Member_Status_Filter/index.xml
@@ -42,26 +42,32 @@
         <body>
           <form id="member-status" method="post" action="#">
             <div class="container-fluid">
-                <div class="row">
-                    <div class="col-xs-4" id="application">
-                        <label for="application-filter">Application</label>
+               <div class="row">
+                    <div class="col-xs-11" id="application">
+                        <label class="col-xs-2" 
for="application-filter">Application</label>
                         <select id="application-filter">
                             <option value="Select Application" disabled>Select 
Application</option>
                         </select>
                     </div>
-                    <div class="col-xs-3" id="cluster">
-                        <label for="cluster-filter">Cluster</label>
+               </div>
+               <div class="row">
+                    <div class="col-xs-11" id="cluster" style="margin-top: 
10px;">
+                        <label class="col-xs-2" 
for="cluster-filter">Cluster</label>
                         <select id="cluster-filter">
                             <option value="All Clusters" selected>All 
Clusters</option>
                         </select>
                     </div>
-                    <div class="btn-div col-xs-5" id="time-interval">
-                         <label for="time-selector">Time</label>
+               </div>
+               <div class="row">
+                    <div class="col-xs-11" id="time-interval" 
style="margin-top: 10px;">
+                         <label class="col-xs-2" 
for="time-selector">Time</label>
                          <input type="button" class="button" value="30 Min" 
onClick="publish(this.value)">
                          <input type="button" class="button" value="1 Hour" 
onClick="publish(this.value)">
                          <input type="button" class="button" value="1 Day" 
onClick="publish(this.value)">
                          <input type="button" class="button" value="1 Week" 
onClick="publish(this.value)">
                          <input type="button" class="button" value="1 Month" 
onClick="publish(this.value)">
+                         <input type="button" class="button" value="6 Month" 
onClick="publish(this.value)">
+                         <input type="button" class="button" value="1 Year" 
onClick="publish(this.value)">
                     </div>
                 </div>
             </div>

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/SparkscriptsMemberInfo/member_information.xml
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/SparkscriptsMemberInfo/member_information.xml
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/SparkscriptsMemberInfo/member_information.xml
index ef838b6..10b4c93 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/SparkscriptsMemberInfo/member_information.xml
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/SparkscriptsMemberInfo/member_information.xml
@@ -32,5 +32,5 @@
         INSERT OVERWRITE TABLE member_details select member_id, instance_type, 
image_id, host_name,
         private_IP_addresses, public_IP_addresses, hypervisor, cpu, ram, 
os_name, os_version from memberinfo;
     </Script>
-    <CronExpression>29 * * * * ?</CronExpression>
+    <CronExpression>0 0/15 * 1/1 * ? *</CronExpression>
 </Analytics>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/SparkscriptsMemberLifecycle/artifact.xml
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/SparkscriptsMemberLifecycle/artifact.xml
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/SparkscriptsMemberLifecycle/artifact.xml
index 153da46..c84e0b0 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/SparkscriptsMemberLifecycle/artifact.xml
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/SparkscriptsMemberLifecycle/artifact.xml
@@ -1,24 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-
- 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.
-
--->
+  ~ Copyright 2005-2015 WSO2, Inc. (http://wso2.com)
+  ~
+  ~ 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.
+  -->
 <artifact name="SparkscriptsMemberLifecycle" version="1.0.0" 
type="analytics/spark" serverRole="DataAnalyticsServer">
-    <file>member_count.xml</file>
+    <file>member_lifecycle.xml</file>
 </artifact>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/SparkscriptsMemberLifecycle/member_count.xml
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/SparkscriptsMemberLifecycle/member_count.xml
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/SparkscriptsMemberLifecycle/member_count.xml
deleted file mode 100644
index efebc24..0000000
--- 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/SparkscriptsMemberLifecycle/member_count.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
-
- 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.
-
--->
-<Analytics>
-    <Name>member_count</Name>
-    <Script>
-        CREATE TEMPORARY TABLE memberstatus
-        USING CarbonAnalytics
-        OPTIONS (tableName "MEMBER_LIFECYCLE");
-
-        create temporary table member_count
-        using CarbonJDBC options (dataSource 
"WSO2_ANALYTICS_PROCESSED_DATA_STORE_DB", tableName "MEMBER_COUNT");
-
-        ;WITH MemberCount as
-        (select application_id, cluster_alias,
-        count(case when member_status='Created' and timestamp &gt; 
current_time(null)-10000 and
-        timestamp&lt;= current_time(null) then 1 else NULL end) as 
created_instance_count,
-        count(case when member_status='Initialized' and timestamp &gt; 
current_time(null)-10000 and
-        timestamp&lt;= current_time(null) then 1 else NULL end) as 
initialized_instance_count,
-        count(case when member_status='Active' and timestamp &gt; 
current_time(null)-10000 and
-        timestamp&lt;= current_time(null) then 1 else NULL end) as 
active_instance_count,
-        count(case when member_status='Terminated' and timestamp &gt; 
current_time(null)-10000 and
-        timestamp&lt;= current_time(null) then 1 else NULL end) as 
terminated_instance_count
-        from memberstatus group by application_id, cluster_alias)
-        INSERT INTO table member_count
-        select current_time(null), application_id, cluster_alias,
-        
created_instance_count,initialized_instance_count,active_instance_count,
-        terminated_instance_count from MemberCount;
-
-        create temporary table member_status_new
-        using CarbonJDBC options (dataSource 
"WSO2_ANALYTICS_PROCESSED_DATA_STORE_DB", tableName "MEMBER_STATUS");
-
-        INSERT OVERWRITE TABLE member_status_new select timestamp, 
application_id, cluster_alias, member_id,
-        member_status from memberstatus;
-    </Script>
-    <CronExpression>0/10 * * * * ?</CronExpression>
-</Analytics>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/SparkscriptsMemberLifecycle/member_lifecycle.xml
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/SparkscriptsMemberLifecycle/member_lifecycle.xml
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/SparkscriptsMemberLifecycle/member_lifecycle.xml
new file mode 100644
index 0000000..ff30944
--- /dev/null
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/SparkscriptsMemberLifecycle/member_lifecycle.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+  ~ Copyright 2005-2015 WSO2, Inc. (http://wso2.com)
+  ~
+  ~ 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.
+  -->
+<Analytics>
+    <Name>member_lifecycle</Name>
+    <Script>
+        CREATE TEMPORARY TABLE memberstatus
+        USING CarbonAnalytics
+        OPTIONS (tableName "MEMBER_LIFECYCLE");
+
+        create temporary table member_status_new
+        using CarbonJDBC options (dataSource 
"WSO2_ANALYTICS_PROCESSED_DATA_STORE_DB", tableName "MEMBER_STATUS");
+
+        INSERT OVERWRITE TABLE member_status_new select timestamp, 
application_id, cluster_alias, member_id,
+        member_status from memberstatus;
+
+        create temporary table member_list
+        using CarbonJDBC options (dataSource "WSO2_ANALYTICS_EVENT_STORE_DB", 
tableName "MEMBER_LIST");
+
+        INSERT OVERWRITE TABLE member_list select cluster_id, member_id,
+        member_status from memberstatus;
+    </Script>
+    <CronExpression>0 0/15 * 1/1 * ? *</CronExpression>
+</Analytics>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/artifacts.xml
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/artifacts.xml
 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/artifacts.xml
index 4f68058..e685e7b 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/artifacts.xml
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/capps/stratos-metering-service/artifacts.xml
@@ -38,6 +38,9 @@
         <dependency artifact="EventreceiverMemberLifecycle" version="1.0.0" 
include="true"
                     serverRole="DataAnalyticsServer"/>
 
+        <dependency artifact="ExecutionplanMemberCount" version="1.0.0" 
include="true"
+                    serverRole="DataAnalyticsServer"/>
+
         <dependency artifact="SparkscriptsApplicationSignUps" version="1.0.0" 
include="true"
                     serverRole="DataAnalyticsServer"/>
         <dependency artifact="SparkscriptsMemberInfo" version="1.0.0" 
include="true" serverRole="DataAnalyticsServer"/>

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/database-scripts/mysql/metering-script.sql
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/database-scripts/mysql/metering-script.sql
 
b/extensions/das/modules/artifacts/metering-dashboard/database-scripts/mysql/metering-script.sql
index f5b6ae1..0acdfbe 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/database-scripts/mysql/metering-script.sql
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/database-scripts/mysql/metering-script.sql
@@ -21,8 +21,6 @@ CREATE DATABASE IF NOT EXISTS ANALYTICS_EVENT_STORE;
 CREATE DATABASE IF NOT EXISTS ANALYTICS_PROCESSED_DATA_STORE;
 CREATE TABLE ANALYTICS_PROCESSED_DATA_STORE.MEMBER_STATUS(Time long, 
ApplicationId VARCHAR(150), ClusterAlias VARCHAR
 (150), MemberId VARCHAR(150), MemberStatus VARCHAR(50));
-CREATE TABLE ANALYTICS_PROCESSED_DATA_STORE.MEMBER_COUNT(Time long, 
ApplicationId VARCHAR(150), ClusterAlias VARCHAR
-(150), CreatedInstanceCount int, InitializedInstanceCount int, 
ActiveInstanceCount int, TerminatedInstanceCount int);
 CREATE TABLE ANALYTICS_PROCESSED_DATA_STORE.MEMBER_INFORMATION(MemberId 
VARCHAR(150), InstanceType VARCHAR(150),
 ImageId VARCHAR(150), HostName VARCHAR(150), PrivateIPAddresses VARCHAR(150), 
PublicIPAddresses VARCHAR(150),
 Hypervisor VARCHAR(150), CPU VARCHAR(10) , RAM VARCHAR(10), OSName 
VARCHAR(150), OSVersion VARCHAR(150));

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/database-scripts/oracle/metering-script.sql
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/database-scripts/oracle/metering-script.sql
 
b/extensions/das/modules/artifacts/metering-dashboard/database-scripts/oracle/metering-script.sql
index 0b31a83..3b9df00 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/database-scripts/oracle/metering-script.sql
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/database-scripts/oracle/metering-script.sql
@@ -17,11 +17,8 @@
 * under the License.
 */
 
-CREATE TABLE MEMBER_STATUS(Time NUMBER(20), ApplicationId VARCHAR2(150), 
ClusterAlias VARCHAR2(150), MemberId VARCHAR2
-(150), MemberStatus VARCHAR2(50));
-CREATE TABLE MEMBER_COUNT(Time NUMBER(20), ApplicationId VARCHAR2(150), 
ClusterAlias VARCHAR2(150),
-CreatedInstanceCount NUMBER(10), InitializedInstanceCount NUMBER(10), 
ActiveInstanceCount NUMBER(10),
-TerminatedInstanceCount NUMBER(10));
+CREATE TABLE MEMBER_STATUS(Time NUMBER(20), ApplicationId VARCHAR2(150), 
ClusterAlias VARCHAR2(150), MemberId
+VARCHAR2(150), MemberStatus VARCHAR2(50));
 CREATE TABLE MEMBER_INFORMATION(MemberId VARCHAR2(150), InstanceType 
VARCHAR2(150), ImageId VARCHAR2(150), HostName
 VARCHAR2(150), PrivateIPAddresses VARCHAR2(150), PublicIPAddresses 
VARCHAR2(150), Hypervisor VARCHAR2(150), CPU
 VARCHAR2(10), RAM VARCHAR2(10), OSName VARCHAR2(150), OSVersion VARCHAR2(150));

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/jaggery-files/mysql/application-signups.jag
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/jaggery-files/mysql/application-signups.jag
 
b/extensions/das/modules/artifacts/metering-dashboard/jaggery-files/mysql/application-signups.jag
index 56158ca..5d249df 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/jaggery-files/mysql/application-signups.jag
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/jaggery-files/mysql/application-signups.jag
@@ -21,17 +21,8 @@
 include('metering-authentication.jag');
 
 (function () {
-    var log = new Log();
-    var ALL_CLUSTERS = 'Select Application';
 
-    var content = request.getContent();
-    var contentAsString = null;
-    if (content != '' && content != null) {
-        contentAsString = stringify(content);
-        if (log.isDebugEnabled()) {
-            log.debug("Value of content: " + contentAsString);
-        }
-    }
+    var ALL_CLUSTERS = 'Select Application';
 
     var db = new Database("WSO2_ANALYTICS_PROCESSED_DATA_STORE_DB");
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/80a73714/extensions/das/modules/artifacts/metering-dashboard/jaggery-files/mysql/applications.jag
----------------------------------------------------------------------
diff --git 
a/extensions/das/modules/artifacts/metering-dashboard/jaggery-files/mysql/applications.jag
 
b/extensions/das/modules/artifacts/metering-dashboard/jaggery-files/mysql/applications.jag
index 851885a..bf95534 100644
--- 
a/extensions/das/modules/artifacts/metering-dashboard/jaggery-files/mysql/applications.jag
+++ 
b/extensions/das/modules/artifacts/metering-dashboard/jaggery-files/mysql/applications.jag
@@ -24,7 +24,7 @@ include('metering-authentication.jag');
     var db = new Database("WSO2_ANALYTICS_PROCESSED_DATA_STORE_DB");
 
     try {
-        var result = db.query("SELECT DISTINCT ApplicationId FROM 
MEMBER_COUNT");
+        var result = db.query("SELECT DISTINCT ApplicationId FROM 
MEMBER_STATUS");
 
         if (result != null) {
             print(result);

Reply via email to