You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by mm...@apache.org on 2018/11/02 13:28:54 UTC

[accumulo] branch master updated: Eliminate use of async:false for ajax requests (#732)

This is an automated email from the ASF dual-hosted git repository.

mmiller pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/master by this push:
     new 51ebbe8  Eliminate use of async:false for ajax requests (#732)
51ebbe8 is described below

commit 51ebbe85f4b4bec94628b33d98b53b6a41db84ab
Author: cleroux <le...@gmail.com>
AuthorDate: Fri Nov 2 06:28:49 2018 -0700

    Eliminate use of async:false for ajax requests (#732)
---
 .../accumulo/monitor/resources/js/bulkImport.js    | 13 ++--
 .../accumulo/monitor/resources/js/functions.js     | 72 ++++++++++------------
 .../org/apache/accumulo/monitor/resources/js/gc.js |  9 +--
 .../accumulo/monitor/resources/js/listType.js      | 11 +---
 .../apache/accumulo/monitor/resources/js/master.js | 12 ++--
 .../apache/accumulo/monitor/resources/js/navbar.js |  9 +--
 .../accumulo/monitor/resources/js/overview.js      | 38 ++++++------
 .../accumulo/monitor/resources/js/problems.js      | 11 ++--
 .../accumulo/monitor/resources/js/replication.js   |  9 +--
 .../apache/accumulo/monitor/resources/js/scans.js  |  9 +--
 .../apache/accumulo/monitor/resources/js/server.js | 17 ++---
 .../apache/accumulo/monitor/resources/js/show.js   | 11 +---
 .../accumulo/monitor/resources/js/summary.js       | 11 +---
 .../apache/accumulo/monitor/resources/js/table.js  |  9 +--
 .../accumulo/monitor/resources/js/tservers.js      | 13 ++--
 .../org/apache/accumulo/monitor/templates/vis.ftl  | 24 +++-----
 16 files changed, 101 insertions(+), 177 deletions(-)

diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/bulkImport.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/bulkImport.js
index 5b0b705..4240e08 100644
--- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/bulkImport.js
+++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/bulkImport.js
@@ -26,15 +26,10 @@ $(document).ready(function() {
  * Makes the REST calls, generates the tables with the new information
  */
 function refreshBulkImport() {
-  $.ajaxSetup({
-    async: false
+  getBulkImports().then(function() {
+    refreshBulkImportTable();
+    refreshServerBulkTable();
   });
-  getBulkImports();
-  $.ajaxSetup({
-    async: true
-  });
-  refreshBulkImportTable();
-  refreshServerBulkTable();
 }
 
 /**
@@ -109,4 +104,4 @@ function refreshServerBulkTable() {
   $('<tr/>', {
     html: items.join('')
   }).appendTo('#bulkImportStatus');
-}
\ No newline at end of file
+}
diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js
index d09cce1..b929eef 100644
--- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js
+++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js
@@ -317,7 +317,7 @@ function makePlot(id, inData, type) {
  * stores it on a sessionStorage variable
  */
 function getMaster() {
-  $.getJSON('/rest/master', function(data) {
+  return $.getJSON('/rest/master', function(data) {
     sessionStorage.master = JSON.stringify(data);
   });
 }
@@ -327,7 +327,7 @@ function getMaster() {
  * stores it on a sessionStorage variable
  */
 function getZK() {
-  $.getJSON('/rest/zk', function(data) {
+  return $.getJSON('/rest/zk', function(data) {
     sessionStorage.zk = JSON.stringify(data);
   });
 }
@@ -336,7 +336,7 @@ function getZK() {
  * REST GET call for the namespaces, stores it on a global variable
  */
 function getNamespaces() {
-  $.getJSON('/rest/tables/namespaces', function(data) {
+  return $.getJSON('/rest/tables/namespaces', function(data) {
     NAMESPACES = JSON.stringify(data);
   });
 }
@@ -357,13 +357,13 @@ function getNamespaceTables(namespaces) {
    * get tables from specific namespaces
    */
   if (namespaces.indexOf('*') != -1) {
-    getTables();
+    return getTables();
   } else {
     // Convert the list to a string for the REST call
     namespaceList = namespaces.toString();
 
     var call = '/rest/tables/namespaces/' + namespaceList;
-    $.getJSON(call, function(data) {
+    return $.getJSON(call, function(data) {
       sessionStorage.tables = JSON.stringify(data);
     });
   }
@@ -373,7 +373,7 @@ function getNamespaceTables(namespaces) {
  * REST GET call for the tables, stores it on a sessionStorage variable
  */
 function getTables() {
-  $.getJSON('/rest/tables', function(data) {
+  return $.getJSON('/rest/tables', function(data) {
     sessionStorage.tables = JSON.stringify(data);
   });
 }
@@ -392,7 +392,7 @@ function clearDeadServers(server) {
  * REST GET call for the tservers, stores it on a sessionStorage variable
  */
 function getTServers() {
-  $.getJSON('/rest/tservers', function(data) {
+  return $.getJSON('/rest/tservers', function(data) {
     sessionStorage.tservers = JSON.stringify(data);
   });
 }
@@ -404,7 +404,7 @@ function getTServers() {
  */
 function getTServer(server) {
   var call = '/rest/tservers/' + server;
-  $.getJSON(call, function(data) {
+  return $.getJSON(call, function(data) {
     sessionStorage.server = JSON.stringify(data);
   });
 }
@@ -413,7 +413,7 @@ function getTServer(server) {
  * REST GET call for the scans, stores it on a sessionStorage variable
  */
 function getScans() {
-  $.getJSON('/rest/scans', function(data) {
+  return $.getJSON('/rest/scans', function(data) {
     sessionStorage.scans = JSON.stringify(data);
   });
 }
@@ -422,7 +422,7 @@ function getScans() {
  * REST GET call for the bulk imports, stores it on a sessionStorage variable
  */
 function getBulkImports() {
-  $.getJSON('/rest/bulkImports', function(data) {
+  return $.getJSON('/rest/bulkImports', function(data) {
     sessionStorage.bulkImports = JSON.stringify(data);
   });
 }
@@ -432,7 +432,7 @@ function getBulkImports() {
  * stores it on a sessionStorage variable
  */
 function getGarbageCollector() {
-  $.getJSON('/rest/gc', function(data) {
+  return $.getJSON('/rest/gc', function(data) {
     sessionStorage.gc = JSON.stringify(data);
   });
 }
@@ -441,7 +441,7 @@ function getGarbageCollector() {
  * REST GET call for the server stats, stores it on a sessionStorage variable
  */
 function getServerStats() {
-  $.getJSON('/rest/tservers/serverStats', function(data) {
+  return $.getJSON('/rest/tservers/serverStats', function(data) {
     sessionStorage.serverStats = JSON.stringify(data);
   });
 }
@@ -450,7 +450,7 @@ function getServerStats() {
  * REST GET call for the recovery list, stores it on a sessionStorage variable
  */
 function getRecoveryList() {
-  $.getJSON('/rest/tservers/recovery', function(data) {
+  return $.getJSON('/rest/tservers/recovery', function(data) {
     sessionStorage.recoveryList = JSON.stringify(data);
   });
 }
@@ -463,7 +463,7 @@ function getRecoveryList() {
  */
 function getTableServers(tableID) {
   var call = '/rest/tables/' + tableID;
-  $.getJSON(call, function(data) {
+  return $.getJSON(call, function(data) {
     sessionStorage.tableServers = JSON.stringify(data);
   });
 }
@@ -475,7 +475,7 @@ function getTableServers(tableID) {
  */
 function getTraceSummary(minutes) {
   var call = '/rest/trace/summary/' + minutes;
-  $.getJSON(call, function(data) {
+  return $.getJSON(call, function(data) {
     sessionStorage.traceSummary = JSON.stringify(data);
   });
 }
@@ -488,7 +488,7 @@ function getTraceSummary(minutes) {
  */
 function getTraceOfType(type, minutes) {
   var call = '/rest/trace/listType/' + type + '/' + minutes;
-  $.getJSON(call, function(data) {
+  return $.getJSON(call, function(data) {
     sessionStorage.traceType = JSON.stringify(data);
   });
 }
@@ -500,7 +500,7 @@ function getTraceOfType(type, minutes) {
  */
 function getTraceShow(id) {
   var call = '/rest/trace/show/' + id;
-  $.getJSON(call, function(data) {
+  return $.getJSON(call, function(data) {
     sessionStorage.traceShow = JSON.stringify(data);
   });
 }
@@ -509,7 +509,7 @@ function getTraceShow(id) {
  * REST GET call for the logs, stores it on a sessionStorage variable
  */
 function getLogs() {
-  $.getJSON('/rest/logs', function(data) {
+  return $.getJSON('/rest/logs', function(data) {
     sessionStorage.logs = JSON.stringify(data);
   });
 }
@@ -522,14 +522,6 @@ function clearLogs() {
 }
 
 /**
- * REST GET call for the problems
- */
-function getProblems() {
-  getProblemSummary();
-  getProblemDetails();
-}
-
-/**
  * REST POST call to clear all table problems
  *
  * @param {string} tableID Table ID
@@ -561,7 +553,7 @@ function clearDetailsProblems(table, resource, type) {
  * stores it on a sessionStorage variable
  */
 function getProblemSummary() {
-  $.getJSON('/rest/problems/summary', function(data) {
+  return $.getJSON('/rest/problems/summary', function(data) {
     sessionStorage.problemSummary = JSON.stringify(data);
   });
 }
@@ -571,7 +563,7 @@ function getProblemSummary() {
  * stores it on a sessionStorage variable
  */
 function getProblemDetails() {
-  $.getJSON('/rest/problems/details', function(data) {
+  return $.getJSON('/rest/problems/details', function(data) {
     sessionStorage.problemDetails = JSON.stringify(data);
   });
 }
@@ -581,7 +573,7 @@ function getProblemDetails() {
  * stores it on a sessionStorage variable
  */
 function getReplication() {
-  $.getJSON('/rest/replication', function(data) {
+  return $.getJSON('/rest/replication', function(data) {
     sessionStorage.replication = JSON.stringify(data);
   });
 }
@@ -593,7 +585,7 @@ function getReplication() {
  * stores it on a sessionStorage variable
  */
 function getIngestRate() {
-  $.getJSON('/rest/statistics/time/ingestRate', function(data) {
+  return $.getJSON('/rest/statistics/time/ingestRate', function(data) {
     sessionStorage.ingestRate = JSON.stringify(data);
   });
 }
@@ -603,7 +595,7 @@ function getIngestRate() {
  * stores it on a sessionStorage variable
  */
 function getScanEntries() {
-  $.getJSON('/rest/statistics/time/scanEntries', function(data) {
+  return $.getJSON('/rest/statistics/time/scanEntries', function(data) {
     sessionStorage.scanEntries = JSON.stringify(data);
   });
 }
@@ -613,7 +605,7 @@ function getScanEntries() {
  * stores it on a sessionStorage variable
  */
 function getIngestByteRate() {
-  $.getJSON('/rest/statistics/time/ingestByteRate', function(data) {
+  return $.getJSON('/rest/statistics/time/ingestByteRate', function(data) {
     sessionStorage.ingestMB = JSON.stringify(data);
   });
 }
@@ -622,7 +614,7 @@ function getIngestByteRate() {
  * REST GET call for the query byte rate, stores it on a sessionStorage variable
  */
 function getQueryByteRate() {
-  $.getJSON('/rest/statistics/time/queryByteRate', function(data) {
+  return $.getJSON('/rest/statistics/time/queryByteRate', function(data) {
     sessionStorage.queryMB = JSON.stringify(data);
   });
 }
@@ -631,7 +623,7 @@ function getQueryByteRate() {
  * REST GET call for the load average, stores it on a sessionStorage variable
  */
 function getLoadAverage() {
-  $.getJSON('/rest/statistics/time/load', function(data) {
+  return $.getJSON('/rest/statistics/time/load', function(data) {
     sessionStorage.loadAvg = JSON.stringify(data);
   });
 }
@@ -640,7 +632,7 @@ function getLoadAverage() {
  * REST GET call for the lookups, stores it on a sessionStorage variable
  */
 function getLookups() {
-  $.getJSON('/rest/statistics/time/lookups', function(data) {
+  return $.getJSON('/rest/statistics/time/lookups', function(data) {
     sessionStorage.lookups = JSON.stringify(data);
   });
 }
@@ -650,7 +642,7 @@ function getLookups() {
  * stores it on a sessionStorage variable
  */
 function getMinorCompactions() {
-  $.getJSON('/rest/statistics/time/minorCompactions', function(data) {
+  return $.getJSON('/rest/statistics/time/minorCompactions', function(data) {
     sessionStorage.minorCompactions = JSON.stringify(data);
   });
 }
@@ -660,7 +652,7 @@ function getMinorCompactions() {
  * stores it on a sessionStorage variable
  */
 function getMajorCompactions() {
-  $.getJSON('/rest/statistics/time/majorCompactions', function(data) {
+  return $.getJSON('/rest/statistics/time/majorCompactions', function(data) {
     sessionStorage.majorCompactions = JSON.stringify(data);
   });
 }
@@ -670,7 +662,7 @@ function getMajorCompactions() {
  * stores it on a sessionStorage variable
  */
 function getIndexCacheHitRate() {
-  $.getJSON('/rest/statistics/time/indexCacheHitRate', function(data) {
+  return $.getJSON('/rest/statistics/time/indexCacheHitRate', function(data) {
     sessionStorage.indexCache = JSON.stringify(data);
   });
 }
@@ -680,7 +672,7 @@ function getIndexCacheHitRate() {
  * stores it on a sessionStorage variable
  */
 function getDataCacheHitRate() {
-  $.getJSON('/rest/statistics/time/dataCacheHitRate', function(data) {
+  return $.getJSON('/rest/statistics/time/dataCacheHitRate', function(data) {
     sessionStorage.dataCache = JSON.stringify(data);
   });
 }
@@ -689,7 +681,7 @@ function getDataCacheHitRate() {
  * REST GET call for the server status, stores it on a sessionStorage variable
  */
 function getStatus() {
-  $.getJSON('/rest/status', function(data) {
+  return $.getJSON('/rest/status', function(data) {
     sessionStorage.status = JSON.stringify(data);
   });
 }
diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/gc.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/gc.js
index e7902a3..f4011b7 100644
--- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/gc.js
+++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/gc.js
@@ -26,14 +26,9 @@ $(document).ready(function() {
  * Makes the REST calls, generates the tables with the new information
  */
 function refreshGC() {
-  $.ajaxSetup({
-    async: false
+  getGarbageCollector().then(function() {
+    refreshGCTable();
   });
-  getGarbageCollector();
-  $.ajaxSetup({
-    async: true
-  });
-  refreshGCTable();
 }
 
 /**
diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/listType.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/listType.js
index 533b165..fdea058 100644
--- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/listType.js
+++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/listType.js
@@ -20,14 +20,9 @@ var type, minutes;
  * Makes the REST calls, generates the tables with the new information
  */
 function refreshListType() {
-  $.ajaxSetup({
-    async: false
+  getTraceOfType(type, minutes).then(function() {
+    refreshTypeTraceTable(minutes);
   });
-  getTraceOfType(type, minutes);
-  $.ajaxSetup({
-    async: true
-  });
-  refreshTypeTraceTable(minutes);
 }
 
 /**
@@ -78,4 +73,4 @@ function refreshTypeTraceTable(minutes) {
       }).appendTo('#trace');
     });
   }
-}
\ No newline at end of file
+}
diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/master.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/master.js
index 49fcf83..8a1717f 100644
--- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/master.js
+++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/master.js
@@ -26,16 +26,12 @@ $(document).ready(function() {
  * Makes the REST calls, generates the tables with the new information
  */
 function refreshMaster() {
-  $.ajaxSetup({
-    async: false
+  getMaster().then(function() {
+    refreshMasterTable();
   });
-  getMaster();
-  getRecoveryList();
-  $.ajaxSetup({
-    async: true
+  getRecoveryList().then(function() {
+    recoveryList();
   });
-  refreshMasterTable();
-  recoveryList();
 }
 
 
diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js
index bd5af7b..4a93db2 100644
--- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js
+++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js
@@ -26,14 +26,9 @@ $(document).ready(function() {
  * Makes the REST calls, generates the sidebar with the new information
  */
 function refreshSidebar() {
-  $.ajaxSetup({
-    async: false
+  getStatus().then(function() {
+    refreshSideBarNotifications();
   });
-  getStatus();
-  $.ajaxSetup({
-    async: true
-  });
-  refreshSideBarNotifications();
 }
 
 /**
diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/overview.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/overview.js
index cebecf8..9aebb3f 100644
--- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/overview.js
+++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/overview.js
@@ -26,27 +26,27 @@ $(document).ready(function() {
  * Makes the REST calls, generates the tables with the new information
  */
 function refreshOverview() {
-  $.ajaxSetup({
-    async: false
+  getMaster().then(function() {
+    refreshMasterTable();
   });
-  getMaster();
-  getZK();
-  getIngestRate();
-  getScanEntries();
-  getIngestByteRate();
-  getQueryByteRate();
-  getLoadAverage();
-  getLookups();
-  getMinorCompactions();
-  getMajorCompactions();
-  getIndexCacheHitRate();
-  getDataCacheHitRate();
-  $.ajaxSetup({
-    async: true
+  getZK().then(function() {
+    refreshZKTable();
+  });
+  var requests = [
+    getIngestRate(),
+    getScanEntries(),
+    getIngestByteRate(),
+    getQueryByteRate(),
+    getLoadAverage(),
+    getLookups(),
+    getMinorCompactions(),
+    getMajorCompactions(),
+    getIndexCacheHitRate(),
+    getDataCacheHitRate()
+  ];
+  $.when(...requests).always(function() {
+    makePlots();
   });
-  refreshMasterTable();
-  refreshZKTable();
-  makePlots();
 }
 
 /**
diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/problems.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/problems.js
index b1e5e16..a9d86c2 100644
--- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/problems.js
+++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/problems.js
@@ -20,15 +20,12 @@ var tableID;
  * Makes the REST calls, generates the tables with the new information
  */
 function refreshProblems() {
-  $.ajaxSetup({
-    async: false
+  getProblemSummary().then(function() {
+    refreshProblemSummaryTable();
   });
-  getProblems();
-  $.ajaxSetup({
-    async: true
+  getProblemDetails().then(function() {
+    refreshProblemDetailsTable();
   });
-  refreshProblemSummaryTable();
-  refreshProblemDetailsTable();
 }
 
 /**
diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/replication.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/replication.js
index 31b8f44..c911420 100644
--- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/replication.js
+++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/replication.js
@@ -26,14 +26,9 @@ $(document).ready(function() {
  * Makes the REST calls, generates the tables with the new information
  */
 function refreshReplication() {
-  $.ajaxSetup({
-    async: false
+  getReplication().then(function() {
+    refreshReplicationsTable();
   });
-  getReplication();
-  $.ajaxSetup({
-    async: true
-  });
-  refreshReplicationsTable();
 }
 
 /**
diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/scans.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/scans.js
index edaf1bb..20ba9ca 100644
--- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/scans.js
+++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/scans.js
@@ -26,14 +26,9 @@ $(document).ready(function() {
  * Makes the REST calls, generates the tables with the new information
  */
 function refreshScans() {
-  $.ajaxSetup({
-    async: false
+  getScans().then(function() {
+    refreshScansTable();
   });
-  getScans();
-  $.ajaxSetup({
-    async: true
-  });
-  refreshScansTable();
 }
 
 /**
diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/server.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/server.js
index 474a271..bd489b8 100644
--- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/server.js
+++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/server.js
@@ -21,17 +21,12 @@ var tabletResults;
  * Makes the REST calls, generates the tables with the new information
  */
 function refreshServer() {
-  $.ajaxSetup({
-    async: false
+  getTServer(serv).then(function() {;
+    refreshDetailTable();
+    refreshHistoryTable();
+    refreshCurrentTable();
+    refreshResultsTable();
   });
-  getTServer(serv);
-  $.ajaxSetup({
-    async: true
-  });
-  refreshDetailTable();
-  refreshHistoryTable();
-  refreshCurrentTable();
-  refreshResultsTable();
 }
 
 /**
@@ -195,4 +190,4 @@ function refreshCurrentTable() {
  */
 function refreshResultsTable() {
   tabletResults.ajax.reload(null, false ); // user paging is not reset on reload
-}
\ No newline at end of file
+}
diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/show.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/show.js
index 8616b3e..1aa2a09 100644
--- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/show.js
+++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/show.js
@@ -19,14 +19,9 @@ var id;
  * Makes the REST calls, generates the tables with the new information
  */
 function refreshTraceShow() {
-  $.ajaxSetup({
-    async: false
+  getTraceShow(id).then(function() {
+    refreshTraceShowTable();
   });
-  getTraceShow(id);
-  $.ajaxSetup({
-    async: true
-  });
-  refreshTraceShowTable();
 }
 
 /**
@@ -107,4 +102,4 @@ function refreshTraceShowTable() {
       $('#trace').append(items.join(''));
   }
 
-}
\ No newline at end of file
+}
diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/summary.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/summary.js
index fce8bd5..07f245d 100644
--- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/summary.js
+++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/summary.js
@@ -19,14 +19,9 @@ var minutes;
  * Makes the REST calls, generates the tables with the new information
  */
 function refreshSummary() {
-  $.ajaxSetup({
-    async: false
+  getTraceSummary(minutes).then(function() {
+    refreshTraceSummaryTable(minutes);
   });
-  getTraceSummary(minutes);
-  $.ajaxSetup({
-    async: true
-  });
-  refreshTraceSummaryTable(minutes);
 }
 
 /**
@@ -83,4 +78,4 @@ function refreshTraceSummaryTable(minutes) {
 
     });
   }
-}
\ No newline at end of file
+}
diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/table.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/table.js
index 325e7ab..4cb940a 100644
--- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/table.js
+++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/table.js
@@ -20,14 +20,9 @@ var tableID;
  * Makes the REST calls, generates the tables with the new information
  */
 function refreshTable() {
-  $.ajaxSetup({
-    async: false
+  getTableServers(tableID).then(function() {
+    refreshTableServersTable();
   });
-  getTableServers(tableID);
-  $.ajaxSetup({
-    async: true
-  });
-  refreshTableServersTable();
 }
 
 /**
diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/tservers.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/tservers.js
index 817db9f..995b55e 100644
--- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/tservers.js
+++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/tservers.js
@@ -76,16 +76,11 @@ $(document).ready(function() {
  * Makes the REST calls, generates the tables with the new information
  */
 function refreshTServers() {
-  $.ajaxSetup({
-    async: false
+  getTServers().then(function() {
+    refreshBadTServersTable();
+    refreshDeadTServersTable();
+    refreshTServersTable();
   });
-  getTServers();
-  $.ajaxSetup({
-    async: true
-  });
-  refreshBadTServersTable();
-  refreshDeadTServersTable();
-  refreshTServersTable();
 }
 
 /**
diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/templates/vis.ftl b/server/monitor/src/main/resources/org/apache/accumulo/monitor/templates/vis.ftl
index b1950d2..cf14d40 100644
--- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/templates/vis.ftl
+++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/templates/vis.ftl
@@ -41,22 +41,16 @@
          * Creates initial visualization table, passes the shape, size, motion, and color from the template
          */
         $(document).ready(function() {
-          $.ajaxSetup({
-            async: false
-          });
-          getServerStats();
-          $.ajaxSetup({
-            async: true
-          });
+          getServerStats().then(function() {
+            setStats();
+            setOptions('${shape}', '${size}', '${motion}', '${color}');
+            setState();
 
-          setStats();
-          setOptions('${shape}', '${size}', '${motion}', '${color}');
-          setState();
-
-          drawGrid();
-          getXML();
-          refresh();
-          drawDots();
+            drawGrid();
+            getXML();
+            refresh();
+            drawDots();
+          });
         });
         // Populates variables to be used in the visualization
         var numCores = 8;