ctubbsii commented on code in PR #2679:
URL: https://github.com/apache/accumulo/pull/2679#discussion_r867010362


##########
server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js:
##########
@@ -426,25 +473,34 @@ function getTraceOfType(type, minutes) {
  */
 function getTraceShow(id) {
   var call = '/rest/trace/show/' + id;
+  console.info("Call to " + call);
   return $.getJSON(call, function(data) {
-    sessionStorage.traceShow = JSON.stringify(data);
+    var jsonDataStr = JSON.stringify(data);
+    sessionStorage.traceShow = jsonDataStr;
+    console.info("REST call to " + call + " stored in sessionStorage.traceShow 
= " + jsonDataStr);
   });
 }
 
 /**
  * REST GET call for the logs, stores it on a sessionStorage variable
  */
 function getLogs() {
-  return $.getJSON('/rest/logs', function(data) {
-    sessionStorage.logs = JSON.stringify(data);
+  var call = '/rest/logs';
+  console.info("Call to " + call);
+  return $.getJSON(call, function(data) {
+    var jsonDataStr = JSON.stringify(data);
+    sessionStorage.logs = jsonDataStr;
+    console.info("REST call to " + call + " stored in sessionStorage.logs = " 
+ jsonDataStr);
   });

Review Comment:
   A lot of these do the same thing. You can probably simplify these by placing 
them in a new function that takes a parameter for the session storage variable. 
In this case, it would be "logs". I found 
https://stackoverflow.com/a/2132814/196405 , which suggests sessionStorage.logs 
is equivalent to: sessionStorage["logs"], so you could pass "logs" as a 
parameter.
   
   Also, I'm thinking these console messages should probably use 
`console.debug`, at least for the second one.
   The "Call to " one could probably stay console.info. It might also be better 
worded as: "Retrieving " or "Loading data from " instead of "Call to ".



-- 
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]

Reply via email to