dlmarion commented on code in PR #5894:
URL: https://github.com/apache/accumulo/pull/5894#discussion_r2737695793
##########
server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/manager.js:
##########
@@ -92,146 +65,106 @@ function refreshManagerTables() {
*/
$(function () {
- // Generates the manager table
- managerStatusTable = $('#managerStatus').DataTable({
- "ajax": {
- "url": contextPath + 'rest/manager',
- "dataSrc": function (json) {
- // the data needs to be in an array to work with DataTables
- var arr = [json];
- return arr;
- }
- },
- "stateSave": true,
- "searching": false,
- "paging": false,
- "info": false,
- "columnDefs": [{
- "targets": "big-num",
- "render": function (data, type) {
- if (type === 'display') {
- data = bigNumberForQuantity(data);
+ getStatus().then(function () {
+ managerStatus = JSON.parse(sessionStorage.status).managerStatus;
+ if (managerStatus !== 'ERROR') {
+ // Generates the manager table
+ managerStatusTable = $('#managerStatusTable').DataTable({
+ "ajax": {
+ "url": contextPath + 'rest-v2/manager',
+ "dataSrc": function (json) {
+ // the data needs to be in an array to work with DataTables
+ var arr = [json];
+ return arr;
}
- return data;
- }
- },
- {
- "targets": "big-num-rounded",
- "render": function (data, type) {
- if (type === 'display') {
- data = bigNumberForQuantity(Math.round(data));
+ },
+ "stateSave": true,
+ "searching": false,
+ "paging": false,
+ "info": false,
+ "columnDefs": [{
+ "targets": "timestamp",
+ "render": function (data, type) {
+ if (type === 'display') {
+ data = dateFormat(data);
+ }
+ return data;
+ }
+ },
+ {
+ "targets": "metrics",
+ "orderable": false,
+ "render": function () {
+ return "<a href=\"rest-v2/manager/metrics\">Metrics</a>";
+ }
}
- return data;
- }
- },
- {
- "targets": "duration",
- "render": function (data, type) {
- if (type === 'display') {
- data = timeDuration(parseInt(data, 10));
+ ],
+ "columns": [{
+ "data": "host"
+ },
+ {
+ "data": "resourceGroup"
+ },
+ {
+ "data": "timestamp"
+ },
+ {
+ "data": "metrics"
+ }
+ ]
+ });
+ }
+
+ // Generates the recovery table
+ recoveryListTable = $('#recoveryList').DataTable({
+ "ajax": {
+ "url": contextPath + 'rest/tservers/recovery',
+ "dataSrc": function (data) {
+ data = data.recoveryList;
+ if (data.length === 0) {
+ console.info('Recovery list is empty, hiding recovery table');
+ $('#recoveryList_wrapper').hide();
+ } else {
+ $('#recoveryList_wrapper').show();
}
return data;
}
- }
- ],
- "columns": [{
- "data": "manager"
- },
- {
- "data": "onlineTabletServers"
},
- {
- "data": "totalTabletServers"
- },
- {
- "data": "lastGC",
- "type": "html",
- "render": function (data, type) {
- if (type === 'display') {
- if (data !== 'Waiting') {
- data = dateFormat(parseInt(data, 10));
+ "columnDefs": [{
+ "targets": "duration",
+ "render": function (data, type) {
+ if (type === 'display') {
+ data = timeDuration(parseInt(data, 10));
}
- data = '<a href="gc">' + data + '</a>';
+ return data;
}
- return data;
- }
- },
- {
- "data": "tablets"
- },
- {
- "data": "unassignedTablets"
- },
- {
- "data": "numentries"
- },
- {
- "data": "ingestrate"
- },
- {
- "data": "entriesRead"
- },
- {
- "data": "queryrate"
- },
- {
- "data": "holdTime"
- },
- {
- "data": "osload"
- },
- ]
- });
-
- // Generates the recovery table
- recoveryListTable = $('#recoveryList').DataTable({
Review Comment:
Added recovery metrics in #6081
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]