[GitHub] nifi pull request #1042: NIFI-2795 Sys Diagnostics in Cluster UI

2016-09-27 Thread jvwing
Github user jvwing closed the pull request at:

https://github.com/apache/nifi/pull/1042


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #1042: NIFI-2795 Sys Diagnostics in Cluster UI

2016-09-21 Thread jvwing
Github user jvwing commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1042#discussion_r79936607
  
--- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js
 ---
@@ -24,13 +24,275 @@ nf.ClusterTable = (function () {
  */
 var config = {
 primaryNode: 'Primary Node',
-clusterCoorindator: 'Cluster Coordinator',
+clusterCoordinator: 'Cluster Coordinator',
 urls: {
 cluster: '../nifi-api/controller/cluster',
-nodes: '../nifi-api/controller/cluster/nodes'
-}
+nodes: '../nifi-api/controller/cluster/nodes',
+systemDiagnostics: '../nifi-api/system-diagnostics'
+},
+data: [{
+name: 'cluster',
+update: refreshClusterData
+},{
+name: 'systemDiagnostics',
+update: refreshSystemDiagnosticsData
+}
+]
 };
 
+var commonTableOptions = {
+forceFitColumns: true,
+enableTextSelectionOnCells: true,
+enableCellNavigation: false,
+enableColumnReorder: false,
+autoEdit: false,
+rowHeight: 24
+};
+
+var nodesTab =  {
+name: 'Nodes',
+data: {
+dataSet: 'cluster',
+update: updateNodesTableData
+},
+tabContentId: 'cluster-nodes-tab-content',
+tableId: 'cluster-nodes-table',
+tableColumnModel: createNodeTableColumnModel,
+tableIdColumn: 'nodeId',
+tableOptions: commonTableOptions,
+tableOnClick: nodesTableOnClick,
+init: commonTableInit,
+onSort: sort,
+onTabSelected: onSelectTab,
+filterOptions: [{
+text: 'by address',
+value: 'address'
+}, {
+text: 'by status',
+value: 'status'
+}]
+};
+
+var jvmTab = {
+name: 'JVM',
+data: {
+dataSet: 'systemDiagnostics',
+update: updateJvmTableData
+},
+tabContentId: 'cluster-jvm-tab-content',
+tableId: 'cluster-jvm-table',
+tableColumnModel: [
+{id: 'node', field: 'node', name: 'Node Address', sortable: 
true, resizable: true},
+{id: 'heapMax', field: 'maxHeap', name: 'Heap Max', sortable: 
true, resizable: true, cssClass: 'cell-right', headerCssClass: 'header-right'},
+{id: 'heapTotal', field: 'totalHeap', name: 'Heap Total', 
sortable: true, resizable: true, cssClass: 'cell-right', headerCssClass: 
'header-right'},
+{id: 'heapUsed', field: 'usedHeap', name: 'Heap Used', 
sortable: true, resizable: true, cssClass: 'cell-right', headerCssClass: 
'header-right'},
+{id: 'heapUtilPct', field: 'heapUtilization', name: 'Heap 
Utilization', sortable: true, resizable: true, cssClass: 'cell-right', 
headerCssClass: 'header-right'},
+{id: 'nonHeapTotal', field: 'totalNonHeap', name: 'Non-Heap 
Total', sortable: true, resizable: true, cssClass: 'cell-right', 
headerCssClass: 'header-right'},
+{id: 'nonHeapUsed', field: 'usedNonHeap', name: 'Non-Heap 
Used', sortable: true, resizable: true, cssClass: 'cell-right', headerCssClass: 
'header-right'},
+{id: 'gcOldGen', field: 'gcOldGen', name: 'G1 Old Generation', 
sortable: true, resizable: true, cssClass: 'cell-right', headerCssClass: 
'header-right'},
+{id: 'gcNewGen', field: 'gcNewGen', name: 'G1 Young 
Generation', sortable: true, resizable: true, cssClass: 'cell-right', 
headerCssClass: 'header-right'}
+],
+tableIdColumn: 'id',
+tableOptions: commonTableOptions,
+tableOnClick: null,
+init: commonTableInit,
+onSort: sort,
+onTabSelected: onSelectTab,
+filterOptions: [{
+text: 'by address',
+value: 'address'
+}]
+};
+
+var systemTab = {
+name: 'System',
+data: {
+dataSet: 'systemDiagnostics',
+update: updateSystemTableData
+},
+tabContentId: 'cluster-system-tab-content',
+tableId: 'cluster-system-table',
+tableColumnModel: [
+{id: 'node', field: 'node', name: 'Node Address', sortable: 
true, resizable: true},
+{id: 'processors', field: 'processors', name: 'Processors', 
sortable: true, resizable: true, cssClass: 'cell-right', headerCssClass: 
'header-right'},
+{id: 'processorLoadAverage', field: 'processorLoadA

[GitHub] nifi pull request #1042: NIFI-2795 Sys Diagnostics in Cluster UI

2016-09-21 Thread jvwing
Github user jvwing commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1042#discussion_r79936555
  
--- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js
 ---
@@ -377,190 +952,45 @@ nf.ClusterTable = (function () {
 nf.ClusterTable.resetTableSize();
 });
 
-// define a custom formatter for the more details column
-var moreDetailsFormatter = function (row, cell, value, 
columnDef, dataContext) {
-return '';
-};
-
-// define a custom formatter for the run status column
-var nodeFormatter = function (row, cell, value, columnDef, 
dataContext) {
-return formatNodeAddress(dataContext);
-};
-
-// function for formatting the last accessed time
-var valueFormatter = function (row, cell, value, columnDef, 
dataContext) {
-return nf.Common.formatValue(value);
-};
-
-// define a custom formatter for the status column
-var statusFormatter = function (row, cell, value, columnDef, 
dataContext) {
-var markup = value;
-if (dataContext.roles.includes(config.primaryNode)) {
-value += ', PRIMARY';
-}
-if (dataContext.roles.includes(config.clusterCoorindator)) 
{
-value += ', COORDINATOR';
-}
-return value;
-};
-
-var columnModel = [
-{id: 'moreDetails', name: ' ', sortable: false, 
resizable: false, formatter: moreDetailsFormatter, width: 50, maxWidth: 50},
-{id: 'node', field: 'node', name: 'Node Address', 
formatter: nodeFormatter, resizable: true, sortable: true},
-{id: 'activeThreadCount', field: 'activeThreadCount', 
name: 'Active Thread Count', resizable: true, sortable: true, defaultSortAsc: 
false},
-{id: 'queued', field: 'queued', name: 'Queue / Size', resizable: true, sortable: true, 
defaultSortAsc: false},
-{id: 'status', field: 'status', name: 'Status', formatter: 
statusFormatter, resizable: true, sortable: true},
-{id: 'uptime', field: 'nodeStartTime', name: 'Uptime', 
formatter: valueFormatter, resizable: true, sortable: true, defaultSortAsc: 
false},
-{id: 'heartbeat', field: 'heartbeat', name: 'Last 
Heartbeat', formatter: valueFormatter, resizable: true, sortable: true, 
defaultSortAsc: false}
-];
-
-// only allow the admin to modify the cluster
-if (nf.Common.canModifyController()) {
-// function for formatting the actions column
-var actionFormatter = function (row, cell, value, 
columnDef, dataContext) {
-var canDisconnect = false;
-var canConnect = false;
-
-// determine the current status
-if (dataContext.status === 'CONNECTED' || 
dataContext.status === 'CONNECTING') {
-canDisconnect = true;
-} else if (dataContext.status === 'DISCONNECTED') {
-canConnect = true;
-}
-
-// return the appropriate markup
-if (canConnect) {
-return ' ';
-} else if (canDisconnect) {
-return '';
-} else {
-return ' ';
-}
-};
-
-columnModel.push({id: 'actions', label: ' ', 
formatter: actionFormatter, resizable: false, sortable: false, width: 80, 
maxWidth: 80});
-}
-
-var clusterOptions = {
-forceFitColumns: true,
-enableTextSelectionOnCells: true,
-enableCellNavigation: false,
-enableColumnReorder: false,
-autoEdit: false,
-rowHeight: 24
-};
-
-// initialize the dataview
-var clusterData = new Slick.Data.DataView({
-inlineFilters: false
-});
-clusterData.setItems([], 'nodeId');
-clusterData.setFilterArgs({
-searchString: getFilterText(),
-property: 
$('#cluster-filter-type').combo('getSelectedOption').value
-});
-clusterData.setFilter(filter);
-
-// initialize the sort
-   

[GitHub] nifi pull request #1042: NIFI-2795 Sys Diagnostics in Cluster UI

2016-09-21 Thread mcgilman
Github user mcgilman commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1042#discussion_r79894191
  
--- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js
 ---
@@ -24,13 +24,275 @@ nf.ClusterTable = (function () {
  */
 var config = {
 primaryNode: 'Primary Node',
-clusterCoorindator: 'Cluster Coordinator',
+clusterCoordinator: 'Cluster Coordinator',
 urls: {
 cluster: '../nifi-api/controller/cluster',
-nodes: '../nifi-api/controller/cluster/nodes'
-}
+nodes: '../nifi-api/controller/cluster/nodes',
+systemDiagnostics: '../nifi-api/system-diagnostics'
+},
+data: [{
+name: 'cluster',
+update: refreshClusterData
+},{
+name: 'systemDiagnostics',
+update: refreshSystemDiagnosticsData
+}
+]
 };
 
+var commonTableOptions = {
+forceFitColumns: true,
+enableTextSelectionOnCells: true,
+enableCellNavigation: false,
+enableColumnReorder: false,
+autoEdit: false,
+rowHeight: 24
+};
+
+var nodesTab =  {
+name: 'Nodes',
+data: {
+dataSet: 'cluster',
+update: updateNodesTableData
+},
+tabContentId: 'cluster-nodes-tab-content',
+tableId: 'cluster-nodes-table',
+tableColumnModel: createNodeTableColumnModel,
+tableIdColumn: 'nodeId',
+tableOptions: commonTableOptions,
+tableOnClick: nodesTableOnClick,
+init: commonTableInit,
+onSort: sort,
+onTabSelected: onSelectTab,
+filterOptions: [{
+text: 'by address',
+value: 'address'
+}, {
+text: 'by status',
+value: 'status'
+}]
+};
+
+var jvmTab = {
+name: 'JVM',
+data: {
+dataSet: 'systemDiagnostics',
+update: updateJvmTableData
+},
+tabContentId: 'cluster-jvm-tab-content',
+tableId: 'cluster-jvm-table',
+tableColumnModel: [
+{id: 'node', field: 'node', name: 'Node Address', sortable: 
true, resizable: true},
+{id: 'heapMax', field: 'maxHeap', name: 'Heap Max', sortable: 
true, resizable: true, cssClass: 'cell-right', headerCssClass: 'header-right'},
+{id: 'heapTotal', field: 'totalHeap', name: 'Heap Total', 
sortable: true, resizable: true, cssClass: 'cell-right', headerCssClass: 
'header-right'},
+{id: 'heapUsed', field: 'usedHeap', name: 'Heap Used', 
sortable: true, resizable: true, cssClass: 'cell-right', headerCssClass: 
'header-right'},
+{id: 'heapUtilPct', field: 'heapUtilization', name: 'Heap 
Utilization', sortable: true, resizable: true, cssClass: 'cell-right', 
headerCssClass: 'header-right'},
+{id: 'nonHeapTotal', field: 'totalNonHeap', name: 'Non-Heap 
Total', sortable: true, resizable: true, cssClass: 'cell-right', 
headerCssClass: 'header-right'},
+{id: 'nonHeapUsed', field: 'usedNonHeap', name: 'Non-Heap 
Used', sortable: true, resizable: true, cssClass: 'cell-right', headerCssClass: 
'header-right'},
+{id: 'gcOldGen', field: 'gcOldGen', name: 'G1 Old Generation', 
sortable: true, resizable: true, cssClass: 'cell-right', headerCssClass: 
'header-right'},
+{id: 'gcNewGen', field: 'gcNewGen', name: 'G1 Young 
Generation', sortable: true, resizable: true, cssClass: 'cell-right', 
headerCssClass: 'header-right'}
+],
+tableIdColumn: 'id',
+tableOptions: commonTableOptions,
+tableOnClick: null,
+init: commonTableInit,
+onSort: sort,
+onTabSelected: onSelectTab,
+filterOptions: [{
+text: 'by address',
+value: 'address'
+}]
+};
+
+var systemTab = {
+name: 'System',
+data: {
+dataSet: 'systemDiagnostics',
+update: updateSystemTableData
+},
+tabContentId: 'cluster-system-tab-content',
+tableId: 'cluster-system-table',
+tableColumnModel: [
+{id: 'node', field: 'node', name: 'Node Address', sortable: 
true, resizable: true},
+{id: 'processors', field: 'processors', name: 'Processors', 
sortable: true, resizable: true, cssClass: 'cell-right', headerCssClass: 
'header-right'},
+{id: 'processorLoadAverage', field: 'processorLoa

[GitHub] nifi pull request #1042: NIFI-2795 Sys Diagnostics in Cluster UI

2016-09-21 Thread mcgilman
Github user mcgilman commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1042#discussion_r79892940
  
--- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js
 ---
@@ -377,190 +952,45 @@ nf.ClusterTable = (function () {
 nf.ClusterTable.resetTableSize();
 });
 
-// define a custom formatter for the more details column
-var moreDetailsFormatter = function (row, cell, value, 
columnDef, dataContext) {
-return '';
-};
-
-// define a custom formatter for the run status column
-var nodeFormatter = function (row, cell, value, columnDef, 
dataContext) {
-return formatNodeAddress(dataContext);
-};
-
-// function for formatting the last accessed time
-var valueFormatter = function (row, cell, value, columnDef, 
dataContext) {
-return nf.Common.formatValue(value);
-};
-
-// define a custom formatter for the status column
-var statusFormatter = function (row, cell, value, columnDef, 
dataContext) {
-var markup = value;
-if (dataContext.roles.includes(config.primaryNode)) {
-value += ', PRIMARY';
-}
-if (dataContext.roles.includes(config.clusterCoorindator)) 
{
-value += ', COORDINATOR';
-}
-return value;
-};
-
-var columnModel = [
-{id: 'moreDetails', name: ' ', sortable: false, 
resizable: false, formatter: moreDetailsFormatter, width: 50, maxWidth: 50},
-{id: 'node', field: 'node', name: 'Node Address', 
formatter: nodeFormatter, resizable: true, sortable: true},
-{id: 'activeThreadCount', field: 'activeThreadCount', 
name: 'Active Thread Count', resizable: true, sortable: true, defaultSortAsc: 
false},
-{id: 'queued', field: 'queued', name: 'Queue / Size', resizable: true, sortable: true, 
defaultSortAsc: false},
-{id: 'status', field: 'status', name: 'Status', formatter: 
statusFormatter, resizable: true, sortable: true},
-{id: 'uptime', field: 'nodeStartTime', name: 'Uptime', 
formatter: valueFormatter, resizable: true, sortable: true, defaultSortAsc: 
false},
-{id: 'heartbeat', field: 'heartbeat', name: 'Last 
Heartbeat', formatter: valueFormatter, resizable: true, sortable: true, 
defaultSortAsc: false}
-];
-
-// only allow the admin to modify the cluster
-if (nf.Common.canModifyController()) {
-// function for formatting the actions column
-var actionFormatter = function (row, cell, value, 
columnDef, dataContext) {
-var canDisconnect = false;
-var canConnect = false;
-
-// determine the current status
-if (dataContext.status === 'CONNECTED' || 
dataContext.status === 'CONNECTING') {
-canDisconnect = true;
-} else if (dataContext.status === 'DISCONNECTED') {
-canConnect = true;
-}
-
-// return the appropriate markup
-if (canConnect) {
-return ' ';
-} else if (canDisconnect) {
-return '';
-} else {
-return ' ';
-}
-};
-
-columnModel.push({id: 'actions', label: ' ', 
formatter: actionFormatter, resizable: false, sortable: false, width: 80, 
maxWidth: 80});
-}
-
-var clusterOptions = {
-forceFitColumns: true,
-enableTextSelectionOnCells: true,
-enableCellNavigation: false,
-enableColumnReorder: false,
-autoEdit: false,
-rowHeight: 24
-};
-
-// initialize the dataview
-var clusterData = new Slick.Data.DataView({
-inlineFilters: false
-});
-clusterData.setItems([], 'nodeId');
-clusterData.setFilterArgs({
-searchString: getFilterText(),
-property: 
$('#cluster-filter-type').combo('getSelectedOption').value
-});
-clusterData.setFilter(filter);
-
-// initialize the sort
- 

[GitHub] nifi pull request #1042: NIFI-2795 Sys Diagnostics in Cluster UI

2016-09-21 Thread jvwing
GitHub user jvwing opened a pull request:

https://github.com/apache/nifi/pull/1042

NIFI-2795 Sys Diagnostics in Cluster UI

Reworked the existing cluster UI to provide tabs containing multiple data 
tables.  Added views for System, JVM, FlowFile Storage and Content Storage 
diagnostics.  This is a UI-only change built on top of the existing System 
Diagnostics API.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jvwing/nifi NIFI-2795-cluster-ui-sysdiag-3

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi/pull/1042.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1042


commit 596d4e933a9547a6af3358840bf5a0fbf762d6da
Author: James Wing 
Date:   2016-09-19T01:06:12Z

NIFI-2795 Sys Diagnostics in Cluster UI




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---