You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2015/04/22 22:48:41 UTC
[3/3] ambari git commit: AMBARI-10648. Integrate Heatmap pages with
widget and widget layout API. (jaimin)
AMBARI-10648. Integrate Heatmap pages with widget and widget layout API. (jaimin)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9639005f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9639005f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9639005f
Branch: refs/heads/trunk
Commit: 9639005f6464117195632d57d4cfbcb9e12e7ed1
Parents: a93a312
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Wed Apr 22 13:48:11 2015 -0700
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Wed Apr 22 13:48:18 2015 -0700
----------------------------------------------------------------------
.../HBASE/0.96.0.2.0/widgets.json | 12 +-
.../common-services/HDFS/2.1.0.2.0/widgets.json | 4 +-
.../common-services/YARN/2.1.0.2.0/widgets.json | 4 +-
.../resources/stacks/HDP/2.0.6/widgets.json | 2 +-
.../stacks/HDP/2.3/services/HBASE/widgets.json | 12 +-
.../widget_layouts/HBASE/default_dashboard.json | 4 +-
.../data/widget_layouts/all_heatmaps.json | 258 ++++++++++
ambari-web/app/assets/test/tests.js | 10 -
ambari-web/app/controllers.js | 19 -
.../app/controllers/main/charts/heatmap.js | 187 +++++--
.../charts/heatmap_metrics/heatmap_metric.js | 88 +---
.../heatmap_metrics/heatmap_metric_cpuWaitIO.js | 39 --
.../heatmap_metrics/heatmap_metric_dfs.js | 45 --
.../heatmap_metric_dfs_bytesread.js | 32 --
.../heatmap_metric_dfs_byteswritten.js | 32 --
.../heatmap_metric_dfs_gctime.js | 29 --
.../heatmap_metric_dfs_memHeapUsed.js | 29 --
.../heatmap_metric_diskspaceused.js | 65 ---
.../heatmap_metrics/heatmap_metric_hbase.js | 46 --
.../heatmap_metric_hbase_compactionqueue.js | 29 --
.../heatmap_metric_hbase_memstoresize.js | 29 --
.../heatmap_metric_hbase_readrequest.js | 29 --
.../heatmap_metric_hbase_regions.js | 29 --
.../heatmap_metric_hbase_writerequest.js | 29 --
.../heatmap_metric_memoryused.js | 63 ---
.../heatmap_metric_processrun.js | 45 --
.../heatmap_metrics/heatmap_metric_yarn.js | 46 --
.../heatmap_metric_yarn_ResourceUsed.js | 66 ---
.../heatmap_metric_yarn_gctime.js | 29 --
.../heatmap_metric_yarn_memHeapUsed.js | 29 --
.../controllers/main/service/info/heatmap.js | 33 +-
.../controllers/main/service/info/summary.js | 115 +----
ambari-web/app/messages.js | 17 -
ambari-web/app/mixins.js | 3 +-
ambari-web/app/mixins/common/widget_mixin.js | 426 ----------------
.../app/mixins/common/widgets/widget_mixin.js | 506 +++++++++++++++++++
.../app/mixins/common/widgets/widget_section.js | 146 ++++++
ambari-web/app/models/widget.js | 2 +
ambari-web/app/routes/main.js | 12 +-
.../templates/common/widget/heatmap_widget.hbs | 39 ++
.../app/templates/main/charts/heatmap.hbs | 78 +--
.../templates/main/charts/heatmap_dropdown.hbs | 38 ++
.../main/service/info/heatmap_dropdown.hbs | 32 ++
ambari-web/app/utils/ajax/ajax.js | 10 +
ambari-web/app/utils/heatmap.js | 2 +-
ambari-web/app/views.js | 1 +
.../views/common/widget/heatmap_widget_view.js | 116 +++++
ambari-web/app/views/main/charts/heatmap.js | 7 +-
.../views/main/charts/heatmap/heatmap_host.js | 5 +
.../views/main/charts/heatmap/heatmap_rack.js | 91 +---
.../app/views/main/service/info/heatmap_view.js | 4 +-
.../app/views/main/service/info/summary.js | 2 +-
.../heatmap_metric_cpuWaitIO_test.js | 113 -----
.../heatmap_metric_dfs_bytesread_test.js | 45 --
.../heatmap_metric_dfs_byteswritten_test.js | 45 --
.../heatmap_metrics/heatmap_metric_dfs_test.js | 115 -----
.../heatmap_metric_diskspaceused_test.js | 116 -----
.../heatmap_metric_hbase_test.js | 125 -----
.../heatmap_metric_memoryused_test.js | 136 -----
.../heatmap_metric_processrun_test.js | 111 ----
.../heatmap_metrics/heatmap_metric_test.js | 43 --
.../heatmap_metric_yarn_ResourceUsed_test.js | 128 -----
.../heatmap_metrics/heatmap_metric_yarn_test.js | 115 -----
.../controllers/main/charts/heatmap_test.js | 52 +-
64 files changed, 1384 insertions(+), 2785 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/widgets.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/widgets.json b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/widgets.json
index 8920843..b79c281 100644
--- a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/widgets.json
+++ b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/widgets.json
@@ -139,7 +139,7 @@
"is_visible": true,
"metrics": [
{
- "name": "ipc.IPC.numOpenConnections",
+ "name": "regionserver.RegionServer.numOpenConnections",
"metric_path": "metrics/hbase/ipc/IPC/numOpenConnections",
"category": "",
"service_name": "HBASE",
@@ -149,7 +149,7 @@
"values": [
{
"name": "Open Connections",
- "value": "${ipc.IPC.numOpenConnections}"
+ "value": "${regionserver.RegionServer.numOpenConnections}"
}
],
"properties": {
@@ -165,13 +165,13 @@
"is_visible": true,
"metrics": [
{
- "name": "ipc.IPC.numActiveHandler",
+ "name": "regionserver.RegionServer.numActiveHandler",
"metric_path": "metrics/hbase/ipc/IPC/numActiveHandler",
"service_name": "HBASE",
"component_name": "HBASE_REGIONSERVER"
},
{
- "name": "ipc.IPC.numCallsInGeneralQueue",
+ "name": "regionserver.RegionServer.numCallsInGeneralQueue",
"metric_path": "metrics/hbase/ipc/IPC/numCallsInGeneralQueue",
"service_name": "HBASE",
"component_name": "HBASE_REGIONSERVER"
@@ -180,11 +180,11 @@
"values": [
{
"name": "Active Handlers",
- "value": "${ipc.IPC.numActiveHandler}"
+ "value": "${regionserver.RegionServer.numActiveHandler}"
},
{
"name": "Calls in General Queue",
- "value": "${ipc.IPC.numCallsInGeneralQueue}"
+ "value": "${regionserver.RegionServer.numCallsInGeneralQueue}"
}
],
"properties": {
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/widgets.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/widgets.json b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/widgets.json
index 622ee03..15b983a 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/widgets.json
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/widgets.json
@@ -7,7 +7,7 @@
"widgetLayoutInfo": [
{
"widget_name": "GC_STATISTICS",
- "display_name": "Garbage Collection Statistics",
+ "display_name": "GC Statistics",
"description": "This widget shows JVM Garbage collection statistics for Active NameNode",
"widget_type": "GRAPH",
"is_visible": true,
@@ -287,7 +287,7 @@
"metrics": [
{
"name": "dfs.datanode.BytesWritten",
- "metric_path": "metrics/dfs/datanode/bytes_read",
+ "metric_path": "metrics/dfs/datanode/bytes_written",
"service_name": "HDFS",
"component_name": "DATANODE"
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/widgets.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/widgets.json b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/widgets.json
index a9e233f..9721b91 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/widgets.json
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/widgets.json
@@ -210,7 +210,7 @@
},
{
"widget_name": "YARN_MEMORY_USED",
- "display_name": "YARN Memory used %",
+ "display_name": "NodeManager Memory used %",
"description": "",
"widget_type": "HEATMAP",
"is_visible": false,
@@ -230,7 +230,7 @@
],
"values": [
{
- "name": "YARN Memory used %",
+ "name": "NodeManager Memory used %",
"value": "${yarn.NodeManagerMetrics.AllocatedGB/(yarn.NodeManagerMetrics.AvailableGB + yarn.NodeManagerMetrics.AllocatedGB)}"
}
],
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-server/src/main/resources/stacks/HDP/2.0.6/widgets.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/widgets.json b/ambari-server/src/main/resources/stacks/HDP/2.0.6/widgets.json
index 7935750..2343616 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/widgets.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/widgets.json
@@ -3,7 +3,7 @@
{
"layout_name": "default_system_heatmap",
"display_name": "Heatmaps",
- "section_name": "SYSTEM_METRICS_HEATMAPS",
+ "section_name": "SYSTEM_HEATMAPS",
"widgetLayoutInfo": [
{
"widget_name": "HOST_DISK_USED",
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/widgets.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/widgets.json b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/widgets.json
index 1212133..19bd480 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/widgets.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/widgets.json
@@ -145,7 +145,7 @@
"is_visible": true,
"metrics": [
{
- "name": "ipc.IPC.numOpenConnections",
+ "name": "regionserver.RegionServer.numOpenConnections",
"metric_path": "metrics/hbase/ipc/IPC/numOpenConnections",
"category": "",
"service_name": "HBASE",
@@ -155,7 +155,7 @@
"values": [
{
"name": "Open Connections",
- "value": "${ipc.IPC.numOpenConnections}"
+ "value": "${regionserver.RegionServer.numOpenConnections}"
}
],
"properties": {
@@ -171,13 +171,13 @@
"is_visible": true,
"metrics": [
{
- "name": "ipc.IPC.numActiveHandler",
+ "name": "regionserver.RegionServer.numActiveHandler",
"metric_path": "metrics/hbase/ipc/IPC/numActiveHandler",
"service_name": "HBASE",
"component_name": "HBASE_REGIONSERVER"
},
{
- "name": "ipc.IPC.numCallsInGeneralQueue",
+ "name": "regionserver.RegionServer.numCallsInGeneralQueue",
"metric_path": "metrics/hbase/ipc/IPC/numCallsInGeneralQueue",
"service_name": "HBASE",
"component_name": "HBASE_REGIONSERVER"
@@ -186,11 +186,11 @@
"values": [
{
"name": "Active Handlers",
- "value": "${ipc.IPC.numActiveHandler}"
+ "value": "${regionserver.RegionServer.numActiveHandler}"
},
{
"name": "Calls in General Queue",
- "value": "${ipc.IPC.numCallsInGeneralQueue}"
+ "value": "${regionserver.RegionServer.numCallsInGeneralQueue}"
}
],
"properties": {
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/assets/data/widget_layouts/HBASE/default_dashboard.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/widget_layouts/HBASE/default_dashboard.json b/ambari-web/app/assets/data/widget_layouts/HBASE/default_dashboard.json
index 9374ab0..8b30c81 100644
--- a/ambari-web/app/assets/data/widget_layouts/HBASE/default_dashboard.json
+++ b/ambari-web/app/assets/data/widget_layouts/HBASE/default_dashboard.json
@@ -36,7 +36,7 @@
"author": "ambari",
"description": "This widget shows 95th percentile of the read latency.",
"scope": "CLUSTER",
- "properties": "{\"display_unit\":\"%\"}",
+ "properties": "{\"display_unit\":\"\"}",
"widget_name": "READ_LATENCY_95",
"widget_type": "NUMBER",
"time_created": 1428990958952,
@@ -53,7 +53,7 @@
"author": "ambari",
"description": "This widget shows 95th percentile of the write latency.",
"scope": "CLUSTER",
- "properties": "{\"display_unit\":\"%\"}",
+ "properties": "{\"display_unit\":\"\"}",
"widget_name": "WRITE_LATENCY_95",
"widget_type": "NUMBER",
"time_created": 1428990958952,
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/assets/data/widget_layouts/all_heatmaps.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/widget_layouts/all_heatmaps.json b/ambari-web/app/assets/data/widget_layouts/all_heatmaps.json
new file mode 100644
index 0000000..903ebc4
--- /dev/null
+++ b/ambari-web/app/assets/data/widget_layouts/all_heatmaps.json
@@ -0,0 +1,258 @@
+
+{
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets?WidgetInfo/widget_type=HEATMAP&WidgetInfo/scope=CLUSTER",
+ "items" : [
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/1",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "Host Disk Space Used %",
+ "id" : 1,
+ "scope" : "CLUSTER",
+ "widget_name" : "HOST_DISK_USED",
+ "widget_type" : "HEATMAP"
+ }
+ },
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/2",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "Host Memory Used %",
+ "id" : 2,
+ "scope" : "CLUSTER",
+ "widget_name" : "HOST_MEMORY_USED",
+ "widget_type" : "HEATMAP"
+ }
+ },
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/3",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "Host CPU Wait IO %",
+ "id" : 3,
+ "scope" : "CLUSTER",
+ "widget_name" : "HOST_CPU_WAIT_IO",
+ "widget_type" : "HEATMAP"
+ }
+ },
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/12",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "HDFS Bytes Read",
+ "id" : 12,
+ "scope" : "CLUSTER",
+ "widget_name" : "HDFS_BYTES_READ",
+ "widget_type" : "HEATMAP"
+ }
+ },
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/13",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "HDFS Bytes Written",
+ "id" : 13,
+ "scope" : "CLUSTER",
+ "widget_name" : "HDFS_BYTES_WRITE",
+ "widget_type" : "HEATMAP"
+ }
+ },
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/14",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "DataNode Garbage Collection Time",
+ "id" : 14,
+ "scope" : "CLUSTER",
+ "widget_name" : "DN_GC_TIME",
+ "widget_type" : "HEATMAP"
+ }
+ },
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/15",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "DataNode JVM Heap Memory Used",
+ "id" : 15,
+ "scope" : "CLUSTER",
+ "widget_name" : "DN_JVM_HEAP_USED",
+ "widget_type" : "HEATMAP"
+ }
+ },
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/16",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "DataNode JVM Heap Memory Committed",
+ "id" : 16,
+ "scope" : "CLUSTER",
+ "widget_name" : "DN_JVM_HEAP_COMMITTED",
+ "widget_type" : "HEATMAP"
+ }
+ },
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/17",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "DataNode Process Disk I/O Utilization",
+ "id" : 17,
+ "scope" : "CLUSTER",
+ "widget_name" : "DN_DISK_IO",
+ "widget_type" : "HEATMAP"
+ }
+ },
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/18",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "DataNode Process Network I/O Utilization",
+ "id" : 18,
+ "scope" : "CLUSTER",
+ "widget_name" : "DN_NETWORK_IO",
+ "widget_type" : "HEATMAP"
+ }
+ },
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/23",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "NodeManager Garbage Collection Time",
+ "id" : 23,
+ "scope" : "CLUSTER",
+ "widget_name" : "NM_GC_TIME",
+ "widget_type" : "HEATMAP"
+ }
+ },
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/24",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "NodeManager JVM Heap Memory Used",
+ "id" : 24,
+ "scope" : "CLUSTER",
+ "widget_name" : "NM_JVM_Heap_Used",
+ "widget_type" : "HEATMAP"
+ }
+ },
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/25",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "YARN Memory used %",
+ "id" : 25,
+ "scope" : "CLUSTER",
+ "widget_name" : "YARN_MEMORY_USED",
+ "widget_type" : "HEATMAP"
+ }
+ },
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/26",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "Allocated Containers",
+ "id" : 26,
+ "scope" : "CLUSTER",
+ "widget_name" : "ALLOCATED_CONTAINER",
+ "widget_type" : "HEATMAP"
+ }
+ },
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/27",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "NodeManager RAM Utilized",
+ "id" : 27,
+ "scope" : "CLUSTER",
+ "widget_name" : "NM_RAM_UTILIZED",
+ "widget_type" : "HEATMAP"
+ }
+ },
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/28",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "NodeManager CPU Utilized",
+ "id" : 28,
+ "scope" : "CLUSTER",
+ "widget_name" : "NM_CPU_UTILIZED",
+ "widget_type" : "HEATMAP"
+ }
+ },
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/37",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "HBase Compaction Queue Size",
+ "id" : 37,
+ "scope" : "CLUSTER",
+ "widget_name" : "HBASE_COMPACTION_QUEUE_SIZE",
+ "widget_type" : "HEATMAP"
+ }
+ },
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/38",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "HBase Memstore Sizes",
+ "id" : 38,
+ "scope" : "CLUSTER",
+ "widget_name" : "HBASE_MEMSTORE_SIZES",
+ "widget_type" : "HEATMAP"
+ }
+ },
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/39",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "HBase Read Request Count",
+ "id" : 39,
+ "scope" : "CLUSTER",
+ "widget_name" : "HBASE_READ_REQUEST",
+ "widget_type" : "HEATMAP"
+ }
+ },
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/40",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "HBase Write Request Count",
+ "id" : 40,
+ "scope" : "CLUSTER",
+ "widget_name" : "HBASE_WRITE_REQUEST",
+ "widget_type" : "HEATMAP"
+ }
+ },
+ {
+ "href" : "http://104.196.82.37:8080/api/v1/clusters/c1/widgets/41",
+ "WidgetInfo" : {
+ "author" : "ambari",
+ "cluster_name" : "c1",
+ "display_name" : "HBase Regions",
+ "id" : 41,
+ "scope" : "CLUSTER",
+ "widget_name" : "HBASE_REGIONS",
+ "widget_type" : "HEATMAP"
+ }
+ }
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/assets/test/tests.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js
index 27aaf95..14a0ea8 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -73,16 +73,6 @@ var files = ['test/init_model_test',
'test/controllers/main/dashboard/config_history_controller_test',
'test/controllers/main/charts/heatmap_test',
'test/controllers/main/charts/heatmap_metrics/heatmap_metric_test',
- 'test/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_test',
- 'test/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_test',
- 'test/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_test',
- 'test/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_bytesread_test',
- 'test/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_byteswritten_test',
- 'test/controllers/main/charts/heatmap_metrics/heatmap_metric_cpuWaitIO_test',
- 'test/controllers/main/charts/heatmap_metrics/heatmap_metric_diskspaceused_test',
- 'test/controllers/main/charts/heatmap_metrics/heatmap_metric_memoryused_test',
- 'test/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_ResourceUsed_test',
- 'test/controllers/main/charts/heatmap_metrics/heatmap_metric_processrun_test',
'test/controllers/main/alerts/manage_alert_groups_controller_test',
'test/controllers/main/host/add_controller_test',
'test/controllers/main/host/configs_service_test',
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js
index 0777187..1540ae8 100644
--- a/ambari-web/app/controllers.js
+++ b/ambari-web/app/controllers.js
@@ -118,25 +118,6 @@ require('controllers/main/host/addHost/step4_controller');
require('controllers/main/host/host_alerts_controller');
require('controllers/main/charts');
require('controllers/main/charts/heatmap_metrics/heatmap_metric');
-require('controllers/main/charts/heatmap_metrics/heatmap_metric_processrun');
-require('controllers/main/charts/heatmap_metrics/heatmap_metric_diskspaceused');
-require('controllers/main/charts/heatmap_metrics/heatmap_metric_cpuWaitIO');
-require('controllers/main/charts/heatmap_metrics/heatmap_metric_memoryused');
-require('controllers/main/charts/heatmap_metrics/heatmap_metric_dfs');
-require('controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_bytesread');
-require('controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_byteswritten');
-require('controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_gctime');
-require('controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_memHeapUsed');
-require('controllers/main/charts/heatmap_metrics/heatmap_metric_yarn');
-require('controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_gctime');
-require('controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_memHeapUsed');
-require('controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_ResourceUsed');
-require('controllers/main/charts/heatmap_metrics/heatmap_metric_hbase');
-require('controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_readrequest');
-require('controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_writerequest');
-require('controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_compactionqueue');
-require('controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_regions');
-require('controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_memstoresize');
require('controllers/main/charts/heatmap');
require('controllers/main/service/info/heatmap');
require('controllers/main/views_controller');
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap.js b/ambari-web/app/controllers/main/charts/heatmap.js
index 02ccbed..8404c2a 100644
--- a/ambari-web/app/controllers/main/charts/heatmap.js
+++ b/ambari-web/app/controllers/main/charts/heatmap.js
@@ -17,35 +17,148 @@
var App = require('app');
-App.MainChartsHeatmapController = Em.Controller.extend({
+App.MainChartsHeatmapController = Em.Controller.extend(App.WidgetSectionMixin, {
name: 'mainChartsHeatmapController',
- rackMap: [],
- modelRacks: [],
+ rackMap: {},
+ racks: [],
rackViews: [],
+
+ /**
+ * Heatmap metrics that are available choices on the page
+ */
+ heatmapCategories: [],
+
+ allHeatmaps:[],
+
+ layoutNameSuffix: "_heatmap",
+
+ sectionNameSuffix: "_HEATMAPS",
+
loadRacksUrlParams: 'fields=Hosts/rack_info,Hosts/host_name,Hosts/public_host_name,Hosts/os_type,Hosts/ip,host_components,metrics/disk,metrics/cpu/cpu_system,metrics/cpu/cpu_user,metrics/memory/mem_total,metrics/memory/mem_free&minimal_response=true',
- racks: function () {
- return this.get('modelRacks');
- }.property('modelRacks.@each.isLoaded'),
+ loadHeatmapsUrlParams: function() {
+ var serviceName = this.get('content.serviceName');
+ if (serviceName) {
+ return 'WidgetInfo/widget_type=HEATMAP&WidgetInfo/scope=CLUSTER&WidgetInfo/metrics.matches(.*\"service_name\":\"' + serviceName + '\".*)&fields=WidgetInfo/metrics';
+ } else {
+ return 'WidgetInfo/widget_type=HEATMAP&WidgetInfo/scope=CLUSTER&fields=WidgetInfo/metrics';
+ }
+ }.property('content.serviceName'),
+
+
+ selectedMetric: null,
+
+ inputMaximum: '',
+
+ /**
+ * Heatmap widget currently shown on the page
+ */
+ activeWidget: function() {
+ if (this.get('widgets') && this.get('widgets').length) {
+ return this.get('widgets')[0];
+ } else {
+ return false;
+ }
+ }.property('widgets.@each'),
+
+
+ /**
+ * This function is called from the binded view of the controller
+ */
+ loadPageData: function() {
+ var self = this;
+ this.resetPageData();
+ this.getAllHeatMaps().done(function(allHeatmapData){
+ allHeatmapData.items.forEach(function(_allHeatmapData) {
+ self.get('allHeatmaps').pushObject(_allHeatmapData.WidgetInfo);
+ });
+ var categories = self.categorizeByServiceName(self.get('allHeatmaps'));
+ self.set('heatmapCategories', categories);
+ self.loadActiveWidgetLayout();
+ });
+ },
+
+ /**
+ * categorize heatmaps with respect to service names
+ * @param {Array} allHeatmaps
+ * @return {Array}
+ */
+ categorizeByServiceName: function(allHeatmaps) {
+ var categories = [];
+ allHeatmaps.forEach(function(_heatmap){
+ var serviceNames = JSON.parse(_heatmap.metrics).mapProperty('service_name').uniq();
+ serviceNames.forEach(function(_serviceName){
+ var category = categories.findProperty('serviceName',_serviceName);
+ if (!category) {
+ categories.pushObject(Em.Object.create({
+ serviceName: _serviceName,
+ displayName: _serviceName === 'STACK' ? 'Host' : App.StackService.find().findProperty('serviceName',_serviceName).get('displayName'),
+ heatmaps: [_heatmap]
+ }));
+ } else {
+ category.get('heatmaps').pushObject(_heatmap);
+ }
+ },this);
+ },this);
+ return categories;
+ },
+
+ /**
+ * clears/resets the data. This function should be called every time user navigates to heatmap page
+ */
+ resetPageData: function() {
+ this.get('heatmapCategories').clear();
+ this.get('allHeatmaps').clear();
+ },
+
+ /**
+ * success callback of <code>loadActiveWidgetLayout()</code>
+ * @overrriden
+ * @param {object|null} data
+ */
+ loadActiveWidgetLayoutSuccessCallback: function (data) {
+ if (data.items[0]) {
+ App.widgetMapper.map(data.items[0].WidgetLayoutInfo);
+ App.widgetLayoutMapper.map(data);
+ this.set('activeWidgetLayout', App.WidgetLayout.find().findProperty('layoutName', this.get('defaultLayoutName')));
+ this.set('isWidgetsLoaded', true);
+ }
+ },
+
+ /**
+ * Gets all heatmap widgets that should be available in select metrics dropdown on heatmap page
+ * @return {$.ajax}
+ */
+ getAllHeatMaps: function() {
+ var urlParams = this.get('loadHeatmapsUrlParams');
+
+ return App.ajax.send({
+ name: 'widgets.get',
+ sender: this,
+ data: {
+ urlParams: urlParams
+ }
+ });
+ },
+
/**
* get hosts from server
*/
loadRacks: function () {
- this.get('modelRacks').clear();
- this.get('rackMap').clear();
+ this.get('racks').clear();
+ this.set('rackMap', {});
var urlParams = this.get('loadRacksUrlParams');
- App.ajax.send({
+ return App.ajax.send({
name: 'hosts.heatmaps',
sender: this,
data: {
urlParams: urlParams
- },
- success: 'getHostsSuccessCallback'
+ }
});
},
- getHostsSuccessCallback: function (data, opt, params) {
+ loadRacksSuccessCallback: function (data, opt, params) {
var hosts = [];
data.items.forEach(function (item) {
hosts.push({
@@ -64,14 +177,14 @@ App.MainChartsHeatmapController = Em.Controller.extend({
});
});
var rackMap = this.indexByRackId(hosts);
- var modelRacks = this.toList(rackMap);
+ var racks = this.toList(rackMap);
//this list has an empty host array property
this.set('rackMap', rackMap);
- this.set('modelRacks', modelRacks);
+ this.set('racks', racks);
},
indexByRackId: function (hosts) {
- var rackMap = [];
+ var rackMap = {};
hosts.forEach(function (host) {
var rackId = host.rack;
if(!rackMap[rackId]) {
@@ -97,7 +210,7 @@ App.MainChartsHeatmapController = Em.Controller.extend({
Em.Object.create({
name: rackKey,
rackId: rackKey,
- hosts: [],
+ hosts: rackMap[rackKey].hosts,
isLoaded: false,
index: i++
})
@@ -107,25 +220,6 @@ App.MainChartsHeatmapController = Em.Controller.extend({
return racks;
},
- allMetrics: function () {
- var metrics = [];
-
- // Display host heatmaps if the stack definition has a host metrics service to display it.
- if(App.get('services.hostMetrics').length) {
- metrics.pushObjects([
- App.MainChartHeatmapDiskSpaceUsedMetric.create(),
- App.MainChartHeatmapMemoryUsedMetric.create(),
- App.MainChartHeatmapCpuWaitIOMetric.create()
- ]);
- }
-
- return metrics;
- }.property(),
-
- selectedMetric: null,
-
- inputMaximum: '',
-
validation: function () {
if (this.get('selectedMetric')) {
if (/^\d+$/.test(this.get('inputMaximum'))) {
@@ -140,7 +234,7 @@ App.MainChartsHeatmapController = Em.Controller.extend({
addRackView: function (view) {
this.get('rackViews').push(view);
- if (this.get('rackViews').length == this.get('modelRacks').length) {
+ if (this.get('rackViews').length == this.get('racks').length) {
this.displayAllRacks();
}
},
@@ -153,28 +247,17 @@ App.MainChartsHeatmapController = Em.Controller.extend({
},
showHeatMapMetric: function (event) {
- var metricItem = event.context;
- if (metricItem) {
- this.set('selectedMetric', metricItem);
- }
+ var self = this;
+ var metricItem = Em.Object.create(event.context);
+ this.saveWidgetLayout([metricItem]).done(function(){
+ self.loadActiveWidgetLayout();
+ });
},
hostToSlotMap: function () {
return this.get('selectedMetric.hostToSlotMap');
}.property('selectedMetric.hostToSlotMap'),
- loadMetrics: function () {
- var selectedMetric = this.get('selectedMetric');
- var hostNames = [];
- if (selectedMetric && this.get('racks').everyProperty('isLoaded', true)) {
- this.get('racks').forEach(function (rack) {
- hostNames = hostNames.concat(rack.hosts.mapProperty('hostName'));
- });
- selectedMetric.refreshHostSlots(hostNames);
- }
- this.set('inputMaximum', this.get('selectedMetric.maximumValue'));
- }.observes('selectedMetric'),
-
/**
* return class name for to be used for containing each rack.
*
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric.js b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric.js
index c4a7b95..58874ef 100644
--- a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric.js
+++ b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric.js
@@ -32,7 +32,7 @@ var heatmap = require('utils/heatmap');
* </ul>
*
*/
-App.MainChartHeatmapMetric = Em.Object.extend(heatmap.mappers, {
+App.MainChartHeatmapMetric = Em.Object.extend({
/**
* Name of this metric
*/
@@ -93,11 +93,6 @@ App.MainChartHeatmapMetric = Em.Object.extend(heatmap.mappers, {
*/
units: '',
- /**
- * Indicates whether this metric is currently loading data from the server.
- * {Boolean}
- */
- loading: false,
/**
* Provides following information about slots in an array of objects.
@@ -199,51 +194,6 @@ App.MainChartHeatmapMetric = Em.Object.extend(heatmap.mappers, {
*/
slotDefinitionLabelSuffix: '',
- defaultMetric: '',
-
- /**
- * Name in the <code>App.ajax</code>
- * @type {String}
- */
- ajaxIndex: 'hosts.metrics',
-
- /**
- * Additional data for ajax-request
- * May be redeclared in child-objects
- * @type {Object}
- */
- ajaxData: {},
-
- /**
- * Maps server JSON into an object where keys are hostnames and values are the
- * true metric values. This function by default will map 'defaultMetric' into
- * its corresponding value.
- *
- * @Function
- */
- metricMapper: function (json) {
- var hostToValueMap = {};
- var metricName = this.get('defaultMetric');
- if (json.items) {
- var props = metricName.split('.');
- json.items.forEach(function (item) {
- var value = item;
- props.forEach(function (prop) {
- if (value != null && prop in value) {
- value = value[prop];
- } else {
- value = null;
- }
- });
- if (value != null) {
- var hostName = item.Hosts.host_name;
- hostToValueMap[hostName] = value;
- }
- });
- }
- return hostToValueMap;
- },
-
hostToValueMap: null,
hostToSlotMap: function () {
@@ -252,7 +202,7 @@ App.MainChartHeatmapMetric = Em.Object.extend(heatmap.mappers, {
var hostToSlotMap = {};
if (hostToValueMap && hostNames) {
hostNames.forEach(function (hostName) {
- var slot = this.calculateSlot(hostToValueMap, hostName)
+ var slot = this.calculateSlot(hostToValueMap, hostName);
if (slot > -1) {
hostToSlotMap[hostName] = slot;
}
@@ -294,40 +244,6 @@ App.MainChartHeatmapMetric = Em.Object.extend(heatmap.mappers, {
},
/**
- * Determines which slot each host falls into. This information is given to
- * the callback's #map(hostnameToSlotObject) method. The
- * 'hostnameToSlotObject' has key as hostname, and the slot index as value.
- */
- refreshHostSlots: function (hostNames) {
- this.set('loading', true);
- this.set('hostNames', hostNames);
- var fixedMetricName = this.get('defaultMetric');
- fixedMetricName = fixedMetricName.replace(/\./g, "/");
- var ajaxData = {
- metricName: fixedMetricName
- };
- jQuery.extend(ajaxData, this.get('ajaxData'));
-
- App.ajax.send({
- name: this.get('ajaxIndex'),
- sender: this,
- data: ajaxData,
- success: 'refreshHostSlotsSuccessCallback',
- error: 'refreshHostSlotsErrorCallback'
- });
- },
-
- refreshHostSlotsSuccessCallback: function (data) {
- var hostToValueMap = this.metricMapper(data);
- this.set('hostToValueMap', hostToValueMap);
- this.set('loading', false);
- },
-
- refreshHostSlotsErrorCallback: function () {
- this.set('loading', false);
- },
-
- /**
* Turns numbers into displayable values. For example 24.345432425 into 24.3
* etc.
*
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_cpuWaitIO.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_cpuWaitIO.js b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_cpuWaitIO.js
deleted file mode 100644
index 35bb947..0000000
--- a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_cpuWaitIO.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-var App = require('app');
-
-/**
- *
- */
-App.MainChartHeatmapCpuWaitIOMetric = App.MainChartHeatmapMetric.extend({
- name: Em.I18n.t('charts.heatmap.metrics.cpuWaitIO'),
- maximumValue: 100,
- defaultMetric: 'metrics.cpu.cpu_wio',
- units: '%',
- slotDefinitionLabelSuffix: '%',
- metricMapper: function (json) {
- var map = this._super(json);
- for ( var host in map) {
- if (host in map) {
- var val = map[host];
- map[host] = (val * 100).toFixed(1);
- }
- }
- return map;
- }
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs.js b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs.js
deleted file mode 100644
index 100a65e..0000000
--- a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-var App = require('app');
-
-/**
- * Base class for any HDFS metric.
- */
-App.MainChartHeatmapDFSMetrics = App.MainChartHeatmapMetric.extend({
-
- ajaxIndex: 'hosts.metrics.host_component',
-
- ajaxData: {
- serviceName: 'HDFS',
- componentName: 'DATANODE'
- },
-
- /**
- * Custom mapper for DFS metrics
- */
- metricMapper: function(json) {
- return this.metricMapperWithTransform(json, this.get('defaultMetric'), this.get('transformValue'));
- },
- /**
- * Utility function which allows extending classes to transform the value
- * assigned to a host.
- *
- * @Function
- */
- transformValue: null
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_bytesread.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_bytesread.js b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_bytesread.js
deleted file mode 100644
index 0d28eb0b..0000000
--- a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_bytesread.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-var App = require('app');
-
-/**
- *
- */
-App.MainChartHeatmapDFSBytesReadMetric = App.MainChartHeatmapDFSMetrics.extend({
- name: Em.I18n.t('charts.heatmap.metrics.bytesRead'),
- maximumValue: 1024, // 1GB
- defaultMetric: 'metrics.dfs.datanode.bytes_read',
- units: 'MB',
- slotDefinitionLabelSuffix: 'MB',
- transformValue: function (value) {
- return value / (1024 * 1024); // bytes divided by 1MB.
- }
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_byteswritten.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_byteswritten.js b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_byteswritten.js
deleted file mode 100644
index 9306241..0000000
--- a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_byteswritten.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-var App = require('app');
-
-/**
- *
- */
-App.MainChartHeatmapDFSBytesWrittenMetric = App.MainChartHeatmapDFSMetrics.extend({
- name: Em.I18n.t('charts.heatmap.metrics.bytesWritten'),
- maximumValue: 1024, // 1GB
- defaultMetric: 'metrics.dfs.datanode.bytes_written',
- units: 'MB',
- slotDefinitionLabelSuffix: 'MB',
- transformValue: function (value) {
- return value / (1024 * 1024); // bytes divided by 1MB.
- }
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_gctime.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_gctime.js b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_gctime.js
deleted file mode 100644
index c39393f..0000000
--- a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_gctime.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-var App = require('app');
-
-/**
- *
- */
-App.MainChartHeatmapDFSGCTimeMillisMetric = App.MainChartHeatmapDFSMetrics.extend({
- name: Em.I18n.t('charts.heatmap.metrics.DFSGarbageCollection'),
- maximumValue: 10000,
- defaultMetric: 'metrics.jvm.gcTimeMillis',
- units: ' ms',
- slotDefinitionLabelSuffix: ' ms'
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_memHeapUsed.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_memHeapUsed.js b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_memHeapUsed.js
deleted file mode 100644
index 18ae47b..0000000
--- a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_dfs_memHeapUsed.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-var App = require('app');
-
-/**
- *
- */
-App.MainChartHeatmapDFSMemHeapUsedMetric = App.MainChartHeatmapDFSMetrics.extend({
- name: Em.I18n.t('charts.heatmap.metrics.DFSMemHeapUsed'),
- maximumValue: 512,
- defaultMetric: 'metrics.jvm.memHeapUsedM',
- units: 'MB',
- slotDefinitionLabelSuffix: 'MB'
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_diskspaceused.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_diskspaceused.js b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_diskspaceused.js
deleted file mode 100644
index 403e034..0000000
--- a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_diskspaceused.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-var App = require('app');
-
-/**
- *
- */
-App.MainChartHeatmapDiskSpaceUsedMetric = App.MainChartHeatmapMetric.extend({
- name: Em.I18n.t('charts.heatmap.metrics.diskSpaceUsed'),
- maximumValue: 100,
- defaultMetric: 'metrics.disk',
- units: '%',
- slotDefinitionLabelSuffix: '%',
- metricMapper: function (json) {
- var hostToValueMap = {};
- var self = this;
- var metricName = this.get('defaultMetric');
- if (json.items) {
- var props = metricName.split('.');
- json.items.forEach(function (item) {
- var value = item;
- props.forEach(function (prop) {
- if (value != null && prop in value) {
- value = value[prop];
- } else {
- value = null;
- }
- });
- if (value != null) {
- value = self.diskUsageFormatted(value.disk_total - value.disk_free, value.disk_total);
- var hostName = item.Hosts.host_name;
- hostToValueMap[hostName] = value;
- }
- });
- }
- return hostToValueMap;
- },
-
- /**
- * Format percent disk usage to float with 2 digits
- */
- diskUsageFormatted: function(diskUsed, diskTotal) {
- var diskUsage = (diskUsed) / diskTotal * 100;
- if (isNaN(diskUsage) || diskUsage < 0 || diskUsage > 100) {
- return Em.I18n.t('charts.heatmap.unknown');
- }
- var s = Math.round(diskUsage * Math.pow(10, 2)) / Math.pow(10, 2);
- return isNaN(s) ? 0 : s;
- }
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase.js b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase.js
deleted file mode 100644
index 9b1fc4a..0000000
--- a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-var App = require('app');
-
-/**
- * Base class for any HDFS metric.
- */
-App.MainChartHeatmapHbaseMetrics = App.MainChartHeatmapMetric.extend({
-
- ajaxIndex: 'hosts.metrics.host_component',
-
- ajaxData: {
- serviceName: 'HBASE',
- componentName: 'HBASE_REGIONSERVER'
- },
-
- /**
- * Custom mapper for HBase metrics
- */
- metricMapper: function(json) {
- return this.metricMapperWithTransform(json, this.get('defaultMetric'), this.get('transformValue'));
- },
-
- /**
- * Utility function which allows extending classes to transform the value
- * assigned to a host.
- *
- * @Function
- */
- transformValue: null
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_compactionqueue.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_compactionqueue.js b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_compactionqueue.js
deleted file mode 100644
index 09cb300..0000000
--- a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_compactionqueue.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-var App = require('app');
-
-/**
- *
- */
-App.MainChartHeatmapHbaseCompactionQueueSize = App.MainChartHeatmapHbaseMetrics.extend({
- name: Em.I18n.t('charts.heatmap.metrics.HbaseRegionServerCompactionQueueSize'),
- maximumValue: 10,
- defaultMetric: 'metrics.hbase.regionserver.compactionQueueSize',
- units: '',
- slotDefinitionLabelSuffix: ''
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_memstoresize.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_memstoresize.js b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_memstoresize.js
deleted file mode 100644
index a4eed4e..0000000
--- a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_memstoresize.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-var App = require('app');
-
-/**
- *
- */
-App.MainChartHeatmapHbaseMemStoreSize = App.MainChartHeatmapHbaseMetrics.extend({
- name: Em.I18n.t('charts.heatmap.metrics.HbaseRegionServerMemStoreSize'),
- maximumValue: 100*1024*1024,
- defaultMetric: 'metrics.hbase.regionserver.memstoreSize',
- units: 'B',
- slotDefinitionLabelSuffix: 'B'
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_readrequest.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_readrequest.js b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_readrequest.js
deleted file mode 100644
index 6f914e6..0000000
--- a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_readrequest.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-var App = require('app');
-
-/**
- *
- */
-App.MainChartHeatmapHbaseReadReqCount = App.MainChartHeatmapHbaseMetrics.extend({
- name: Em.I18n.t('charts.heatmap.metrics.HbaseRegionServerReadCount'),
- maximumValue: 200,
- defaultMetric: 'metrics.hbase.regionserver.readRequestsCount',
- units: '',
- slotDefinitionLabelSuffix: ''
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_regions.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_regions.js b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_regions.js
deleted file mode 100644
index a2c2c11..0000000
--- a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_regions.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-var App = require('app');
-
-/**
- *
- */
-App.MainChartHeatmapHbaseRegions = App.MainChartHeatmapHbaseMetrics.extend({
- name: Em.I18n.t('charts.heatmap.metrics.HbaseRegionServerRegions'),
- maximumValue: 10,
- defaultMetric: 'metrics.hbase.regionserver.regions',
- units: '',
- slotDefinitionLabelSuffix: ''
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_writerequest.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_writerequest.js b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_writerequest.js
deleted file mode 100644
index f81ab63..0000000
--- a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_writerequest.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-var App = require('app');
-
-/**
- *
- */
-App.MainChartHeatmapHbaseWriteReqCount = App.MainChartHeatmapHbaseMetrics.extend({
- name: Em.I18n.t('charts.heatmap.metrics.HbaseRegionServerWriteCount'),
- maximumValue: 200,
- defaultMetric: 'metrics.hbase.regionserver.writeRequestsCount',
- units: '',
- slotDefinitionLabelSuffix: ''
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_memoryused.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_memoryused.js b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_memoryused.js
deleted file mode 100644
index 335966d..0000000
--- a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_memoryused.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-var App = require('app');
-
-/**
- * Base class for any heatmap metric.
- *
- * This class basically provides the following for each heatmap metric.
- * <ul>
- * <li> Provides number of slots in which temperature can fall.
- * <li> Maintains the maximum value so as to scale slot ranges.
- * <li> Gets JSON data from server and maps response for all hosts into above
- * slots.
- * </ul>
- *
- */
-App.MainChartHeatmapMemoryUsedMetric = App.MainChartHeatmapMetric.extend({
- name: Em.I18n.t('charts.heatmap.metrics.memoryUsed'),
- maximumValue: 100,
- defaultMetric: 'metrics.memory',
- units: '%',
- slotDefinitionLabelSuffix: '%',
- metricMapper: function (json) {
- var hostToValueMap = {};
- var metricName = this.get('defaultMetric');
- if (json.items) {
- var props = metricName.split('.');
- json.items.forEach(function (item) {
- var value = item;
- props.forEach(function (prop) {
- if (value != null && prop in value) {
- value = value[prop];
- } else {
- value = null;
- }
- });
- if (value != null) {
- var total = value.mem_total;
- var used = value.mem_total - value.mem_free - value.mem_cached;
- value = ((used * 100) / total).toFixed(1);
- var hostName = item.Hosts.host_name;
- hostToValueMap[hostName] = value;
- }
- });
- }
- return hostToValueMap;
- }
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_processrun.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_processrun.js b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_processrun.js
deleted file mode 100644
index 20de918..0000000
--- a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_processrun.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-var App = require('app');
-
-/**
- * Base class for any heatmap metric.
- *
- * This class basically provides the following for each heatmap metric.
- * <ul>
- * <li> Provides number of slots in which temperature can fall.
- * <li> Maintains the maximum value so as to scale slot ranges.
- * <li> Gets JSON data from server and maps response for all hosts into above
- * slots.
- * </ul>
- *
- */
-App.MainChartHeatmapProcessRunMetric = App.MainChartHeatmapMetric.extend({
- name: Em.I18n.t('charts.heatmap.metrics.processRun'),
- maximumValue: 1,
- defaultMetric: 'metrics.process.proc_run',
- units: 'Processes',
- metricMapper: function (json) {
- var map = this._super(json);
- for (var host in map) {
- var val = map[host];
- map[host] = val.toFixed(1);
- }
- return map;
- }
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn.js b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn.js
deleted file mode 100644
index f60075d..0000000
--- a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-var App = require('app');
-
-/**
- * Base class for any YARN metric.
- */
-App.MainChartHeatmapYarnMetrics = App.MainChartHeatmapMetric.extend({
-
- ajaxIndex: 'hosts.metrics.host_component',
-
- ajaxData: {
- serviceName: 'YARN',
- componentName: 'NODEMANAGER'
- },
-
- /**
- * Custom mapper for YARN metrics
- */
- metricMapper: function(json) {
- return this.metricMapperWithTransform(json, this.get('defaultMetric'), this.get('transformValue'));
- },
-
- /**
- * Utility function which allows extending classes to transform the value
- * assigned to a host.
- *
- * @Function
- */
- transformValue: null
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_ResourceUsed.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_ResourceUsed.js b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_ResourceUsed.js
deleted file mode 100644
index f0ee406..0000000
--- a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_ResourceUsed.js
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-var App = require('app');
-
-/**
- *
- */
-App.MainChartHeatmapYarnResourceUsedMetric = App.MainChartHeatmapYarnMetrics.extend({
- name: Em.I18n.t('charts.heatmap.metrics.YarnMemoryUsed'),
- maximumValue: 100,
- defaultMetric: 'metrics.yarn',
- units: ' %',
- slotDefinitionLabelSuffix: ' %',
-
- metricMapper: function (json) {
- var hostToValueMap = {};
- var self = this;
- var metricName = this.get('defaultMetric');
- if (json.host_components) {
- var props = metricName.split('.');
- json.host_components.forEach(function (host) {
- var value = host;
- props.forEach(function (prop) {
- if (value != null && prop in value) {
- value = value[prop];
- } else {
- value = null;
- }
- });
- if (value != null) {
- value = self.memoryUsageFormatted(value.AllocatedGB, value.AvailableGB + value.AllocatedGB);
- var hostName = host.HostRoles.host_name;
- hostToValueMap[hostName] = value;
- }
- });
- }
- return hostToValueMap;
- },
-
- /**
- * Format percent YARN memory used to float with 2 digits
- */
- memoryUsageFormatted: function(used, total) {
- var usage = (used) / total * 100;
- if (isNaN(usage) || usage < 0 || usage > 100) {
- return Em.I18n.t('charts.heatmap.unknown');
- }
- var s = usage.toFixed(1);
- return isNaN(s) ? 0 : s;
- }
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_gctime.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_gctime.js b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_gctime.js
deleted file mode 100644
index 10efe65..0000000
--- a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_gctime.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-var App = require('app');
-
-/**
- *
- */
-App.MainChartHeatmapYarnGCTimeMillisMetric = App.MainChartHeatmapYarnMetrics.extend({
- name: Em.I18n.t('charts.heatmap.metrics.YarnGCTime'),
- maximumValue: 10000,
- defaultMetric: 'metrics.jvm.gcTimeMillis',
- units: ' ms',
- slotDefinitionLabelSuffix: ' ms'
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_memHeapUsed.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_memHeapUsed.js b/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_memHeapUsed.js
deleted file mode 100644
index 762c0bf..0000000
--- a/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_memHeapUsed.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-var App = require('app');
-
-/**
- *
- */
-App.MainChartHeatmapYarnMemHeapUsedMetric = App.MainChartHeatmapYarnMetrics.extend({
- name: Em.I18n.t('charts.heatmap.metrics.YarnMemHeapUsed'),
- maximumValue: 512,
- defaultMetric: 'metrics.jvm.memHeapUsedM',
- units: 'MB',
- slotDefinitionLabelSuffix: 'MB'
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/service/info/heatmap.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/heatmap.js b/ambari-web/app/controllers/main/service/info/heatmap.js
index 467b8d7..2de6af0 100644
--- a/ambari-web/app/controllers/main/service/info/heatmap.js
+++ b/ambari-web/app/controllers/main/service/info/heatmap.js
@@ -17,36 +17,5 @@
*/
var App = require('app');
App.MainServiceInfoHeatmapController = App.MainChartsHeatmapController.extend({
- name: 'mainServiceInfoHeatmapController',
- allMetrics: function () {
- var metrics = [];
- var serviceName = this.get('content.serviceName');
- switch (serviceName) {
- case 'HDFS':
- metrics.pushObjects([
- App.MainChartHeatmapDFSBytesReadMetric.create(),
- App.MainChartHeatmapDFSBytesWrittenMetric.create(),
- App.MainChartHeatmapDFSGCTimeMillisMetric.create(),
- App.MainChartHeatmapDFSMemHeapUsedMetric.create()
- ]);
- break;
- case 'YARN':
- metrics.pushObjects([
- App.MainChartHeatmapYarnGCTimeMillisMetric.create(),
- App.MainChartHeatmapYarnMemHeapUsedMetric.create(),
- App.MainChartHeatmapYarnResourceUsedMetric.create()
- ]);
- break;
- case 'HBASE':
- metrics.pushObjects([
- App.MainChartHeatmapHbaseReadReqCount.create(),
- App.MainChartHeatmapHbaseWriteReqCount.create(),
- App.MainChartHeatmapHbaseCompactionQueueSize.create(),
- App.MainChartHeatmapHbaseRegions.create(),
- App.MainChartHeatmapHbaseMemStoreSize.create()
- ]);
- break;
- }
- return metrics;
- }.property('content.serviceName')
+ name: 'mainServiceInfoHeatmapController'
});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/controllers/main/service/info/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/summary.js b/ambari-web/app/controllers/main/service/info/summary.js
index 882eade..4d902a6 100644
--- a/ambari-web/app/controllers/main/service/info/summary.js
+++ b/ambari-web/app/controllers/main/service/info/summary.js
@@ -17,7 +17,7 @@
var App = require('app');
-App.MainServiceInfoSummaryController = Em.Controller.extend({
+App.MainServiceInfoSummaryController = Em.Controller.extend(App.WidgetSectionMixin, {
name: 'mainServiceInfoSummaryController',
selectedFlumeAgent: null,
@@ -40,29 +40,9 @@ App.MainServiceInfoSummaryController = Em.Controller.extend({
*/
isPreviousRangerConfigsCallFailed: false,
- /**
- * UI section name
- */
- sectionName: function () {
- return this.get('content.serviceName') + "_SUMMARY";
- }.property('content.serviceName'),
-
- /**
- * UI default layout name
- */
- defaultLayoutName: function () {
- return "default_" + this.get('content.serviceName').toLowerCase() + "_dashboard";
- }.property('content.serviceName'),
+ layoutNameSuffix: "_dashboard",
- /**
- * Does Service has widget descriptor defined in the stack
- * @type {boolean}
- */
- isServiceWithEnhancedWidgets: function () {
- var serviceName = this.get('content.serviceName');
- var stackService = App.StackService.find().findProperty('serviceName', serviceName);
- return stackService.get('isServiceWithWidgets') && App.supports.customizedWidgets;
- }.property('content.serviceName'),
+ sectionNameSuffix: "_SUMMARY",
/**
* Ranger plugins data
@@ -317,10 +297,6 @@ App.MainServiceInfoSummaryController = Em.Controller.extend({
});
},
- /**
- * @type {boolean}
- */
- isWidgetsLoaded: false,
/**
* @type {boolean}
@@ -337,24 +313,6 @@ App.MainServiceInfoSummaryController = Em.Controller.extend({
*/
isMineWidgetsLoaded: false,
- /**
- * @Type {App.WidgetLayout}
- */
- activeWidgetLayout: {},
-
-
- /**
- * @type {Em.A}
- */
- widgets: function () {
- if (this.get('isWidgetsLoaded')) {
- if (this.get('activeWidgetLayout.widgets')) {
- return this.get('activeWidgetLayout.widgets').toArray();
- } else {
- return [];
- }
- }
- }.property('isWidgetsLoaded'),
/**
* @type {Em.A}
@@ -384,41 +342,6 @@ App.MainServiceInfoSummaryController = Em.Controller.extend({
this.set('isWidgetLayoutsLoaded', true);
},
- /**
- * load widgets defined by user
- * @returns {$.ajax}
- */
- loadActiveWidgetLayout: function () {
- this.set('activeWidgetLayout', {});
- this.set('isWidgetsLoaded', false);
- if (this.get('isServiceWithEnhancedWidgets')) {
- return App.ajax.send({
- name: 'widget.layout.get',
- sender: this,
- data: {
- layoutName: this.get('defaultLayoutName'),
- serviceName: this.get('content.serviceName')
- },
- success: 'loadActiveWidgetLayoutSuccessCallback'
- });
- } else {
- this.set('isWidgetsLoaded', true);
- }
- },
-
-
- /**
- * success callback of <code>loadWidgets()</code>
- * @param {object|null} data
- */
- loadActiveWidgetLayoutSuccessCallback: function (data) {
- if (data.items[0]) {
- App.widgetMapper.map(data.items[0].WidgetLayoutInfo);
- App.widgetLayoutMapper.map(data);
- this.set('activeWidgetLayout', App.WidgetLayout.find().findProperty('layoutName', this.get('defaultLayoutName')));
- this.set('isWidgetsLoaded', true);
- }
- },
/**
* load all shared widgets to show on widget browser
@@ -525,7 +448,7 @@ App.MainServiceInfoSummaryController = Em.Controller.extend({
});
widgetIds.pushObject({
"id": widgetToAdd.id
- })
+ });
var data = {
"WidgetLayoutInfo": {
"display_name": activeLayout.get("displayName"),
@@ -645,36 +568,6 @@ App.MainServiceInfoSummaryController = Em.Controller.extend({
},
/**
- * save layout after re-order widgets
- * return {$.ajax}
- */
- saveReorderedLayout: function (widgets) {
- var activeLayout = this.get('activeWidgetLayout');
- var data = {
- "WidgetLayoutInfo": {
- "display_name": activeLayout.get("displayName"),
- "id": activeLayout.get("id"),
- "layout_name": activeLayout.get("layoutName"),
- "scope": activeLayout.get("scope"),
- "section_name": activeLayout.get("sectionName"),
- "widgets": widgets.map(function (widget) {
- return {
- "id": widget.get('id')
- }
- })
- }
- };
- return App.ajax.send({
- name: 'widget.layout.edit',
- sender: this,
- data: {
- layoutId: activeLayout.get("id"),
- data: data
- }
- });
- },
-
- /**
* create widget
*/
createWidget: function () {
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 5da43f9..2416384 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2227,23 +2227,6 @@ Em.I18n.translations = {
'charts.heatmap.unknown': 'Unknown',
'charts.heatmap.label.notApplicable' :'Not Applicable',
'charts.heatmap.label.invalidData' :'Invalid data',
- 'charts.heatmap.metrics.bytesRead' :'HDFS Bytes Read',
- 'charts.heatmap.metrics.bytesWritten' :'HDFS Bytes Written',
- 'charts.heatmap.metrics.DFSGarbageCollection' :'HDFS Garbage Collection Time',
- 'charts.heatmap.metrics.DFSMemHeapUsed' :'HDFS JVM Heap Memory Used',
- 'charts.heatmap.metrics.diskSpaceUsed' :'Host Disk Space Used %',
- 'charts.heatmap.metrics.YarnGCTime' :'YARN Garbage Collection Time',
- 'charts.heatmap.metrics.YarnMemHeapUsed' :'YARN JVM Heap Memory Used',
-
- 'charts.heatmap.metrics.memoryUsed' :'Host Memory Used %',
- 'charts.heatmap.metrics.processRun' :'Total Running Processes',
- 'charts.heatmap.metrics.YarnMemoryUsed' :'YARN Memory used %',
- 'charts.heatmap.metrics.cpuWaitIO':'Host CPU Wait I/O %',
- 'charts.heatmap.metrics.HbaseRegionServerReadCount': 'HBase Read Request Count',
- 'charts.heatmap.metrics.HbaseRegionServerWriteCount': 'HBase Write Request Count',
- 'charts.heatmap.metrics.HbaseRegionServerCompactionQueueSize': 'HBase Compaction Queue Size',
- 'charts.heatmap.metrics.HbaseRegionServerRegions': 'HBase Regions',
- 'charts.heatmap.metrics.HbaseRegionServerMemStoreSize': 'HBase Memstore Sizes',
'metric.notFound':'no items found',
'metric.default':'combined',
'metric.cpu':'cpu',
http://git-wip-us.apache.org/repos/asf/ambari/blob/9639005f/ambari-web/app/mixins.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins.js b/ambari-web/app/mixins.js
index a272c24..2ff5de8 100644
--- a/ambari-web/app/mixins.js
+++ b/ambari-web/app/mixins.js
@@ -45,6 +45,7 @@ require('mixins/wizard/wizard_menu_view');
require('mixins/wizard/assign_master_components');
require('mixins/common/configs/enhanced_configs');
require('mixins/common/configs/configs_saver');
-require('mixins/common/widget_mixin');
+require('mixins/common/widgets/widget_mixin');
+require('mixins/common/widgets/widget_section');
require('mixins/unit_convert/base_unit_convert_mixin');
require('mixins/unit_convert/convert_unit_widget_view_mixin');