accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bil...@apache.org
Subject svn commit: r1296426 - in /incubator/accumulo/trunk: ./ src/core/ src/server/ src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/ src/server/src/main/resources/web/
Date Fri, 02 Mar 2012 20:05:05 GMT
Author: billie
Date: Fri Mar  2 20:05:04 2012
New Revision: 1296426

URL: http://svn.apache.org/viewvc?rev=1296426&view=rev
Log:
ACCUMULO-431 improved info box - merged to trunk

Modified:
    incubator/accumulo/trunk/   (props changed)
    incubator/accumulo/trunk/src/core/   (props changed)
    incubator/accumulo/trunk/src/server/   (props changed)
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/VisServlet.java
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/XMLServlet.java
    incubator/accumulo/trunk/src/server/src/main/resources/web/vis.xml

Propchange: incubator/accumulo/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar  2 20:05:04 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611,1228195,1230180,1230736,1231043,1236873,1245632
 /incubator/accumulo/branches/1.3.5rc:1209938
-/incubator/accumulo/branches/1.4:1201902-1296358
+/incubator/accumulo/branches/1.4:1201902-1296423

Propchange: incubator/accumulo/trunk/src/core/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar  2 20:05:04 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3/src/core:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215
 /incubator/accumulo/branches/1.3.5rc/src/core:1209938
-/incubator/accumulo/branches/1.4/src/core:1201902-1296358
+/incubator/accumulo/branches/1.4/src/core:1201902-1296423

Propchange: incubator/accumulo/trunk/src/server/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar  2 20:05:04 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3/src/server:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611
 /incubator/accumulo/branches/1.3.5rc/src/server:1209938
-/incubator/accumulo/branches/1.4/src/server:1201902-1296358
+/incubator/accumulo/branches/1.4/src/server:1201902-1296423

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/VisServlet.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/VisServlet.java?rev=1296426&r1=1296425&r2=1296426&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/VisServlet.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/VisServlet.java
Fri Mar  2 20:05:04 2012
@@ -191,6 +191,15 @@ public class VisServlet extends BasicSer
     // canvas
     sb.append("<br><canvas id='visCanvas' width='").append(width).append("' height='").append(height).append("'>Browser
does not support canvas.</canvas>\n\n");
     sb.append("</div>\n\n");
+  }
+  
+  private void addOptions(StringBuilder sb, StatType selectedStatType) {
+    for (StatType st : StatType.values()) {
+      sb.append("<option").append(st.equals(selectedStatType) ? " selected='true'>"
: ">").append(st.getDescription()).append("</option>");
+    }
+  }
+  
+  private void doScript(StringBuilder sb, ArrayList<TabletServerStatus> tservers) {
     // initialization of some javascript variables
     sb.append("<script type='text/javascript'>\n");
     sb.append("var numCores = " + ManagementFactory.getOperatingSystemMXBean().getAvailableProcessors()
+ ";\n");
@@ -220,15 +229,7 @@ public class VisServlet extends BasicSer
     sb.append("]; // values will be converted by floor(this*value)/this\n");
     sb.append("var numNormalStats = ").append(StatType.values().length - StatType.numDerived()).append(";\n");
     sb.append("</script>\n");
-  }
-  
-  private void addOptions(StringBuilder sb, StatType selectedStatType) {
-    for (StatType st : StatType.values()) {
-      sb.append("<option").append(st.equals(selectedStatType) ? " selected='true'>"
: ">").append(st.getDescription()).append("</option>");
-    }
-  }
-  
-  private void doScript(StringBuilder sb, ArrayList<TabletServerStatus> tservers) {
+    
     InputStream data = VisServlet.class.getClassLoader().getResourceAsStream("web/vis.xml");
     if (data != null) {
       byte[] buffer = new byte[1024];

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/XMLServlet.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/XMLServlet.java?rev=1296426&r1=1296425&r2=1296426&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/XMLServlet.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/XMLServlet.java
Fri Mar  2 20:05:04 2012
@@ -33,6 +33,7 @@ import org.apache.accumulo.core.master.t
 import org.apache.accumulo.server.client.HdfsZooInstance;
 import org.apache.accumulo.server.master.state.TabletServerState;
 import org.apache.accumulo.server.monitor.Monitor;
+import org.apache.accumulo.server.monitor.util.celltypes.TServerLinkType;
 
 public class XMLServlet extends BasicServlet {
   private static final long serialVersionUID = 1L;
@@ -66,6 +67,7 @@ public class XMLServlet extends BasicSer
     for (TabletServerStatus status : Monitor.getMmi().tServerInfo) {
       
       sb.append("\n<server id='").append(status.name).append("'>\n");
+      sb.append("<hostname>").append(TServerLinkType.displayName(status.name)).append("</hostname>");
       sb.append("<lastContact>").append(System.currentTimeMillis() - status.lastContact).append("</lastContact>\n");
       sb.append("<osload>").append(status.osLoad).append("</osload>\n");
       

Modified: incubator/accumulo/trunk/src/server/src/main/resources/web/vis.xml
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/resources/web/vis.xml?rev=1296426&r1=1296425&r2=1296426&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/resources/web/vis.xml (original)
+++ incubator/accumulo/trunk/src/server/src/main/resources/web/vis.xml Fri Mar  2 20:05:04
2012
@@ -85,14 +85,17 @@ function handleNewData() {
   var deadinfo = xmlhttp.responseXML.getElementsByTagName('deadTabletServer');
   var badinfo = xmlhttp.responseXML.getElementsByTagName('badTabletServer');
   var idinfo = xmlhttp.responseXML.getElementsByTagName('server');
+  var hostinfo = xmlhttp.responseXML.getElementsByTagName('hostname');
   
   var statValues = new Array(numNormalStats);
   for (i=0; i < idinfo.length; i++) {
     var info = idinfo[i].attributes[0].nodeValue;
-    var extra = '<br>';
+    var extra = ' (' + hostinfo[i].childNodes[0].nodeValue + ')';
     for (j=0; j < numNormalStats; j++) {
+      if (j % 4 == 0)
+        extra = extra + '<br>\n';
       statValues[j] = Math.max(0,Math.floor(significance[j]*parseFloat(statinfo[j][i].childNodes[0].nodeValue))/significance[j]);
-      extra = extra + ' ' + statName[j] + ': ' + statValues[j];
+      extra = extra + '&nbsp;&nbsp;' + statName[j] + ': <strong>' + statValues[j]
+ '</strong>';
     }
     setStats(statValues,i);
     setDotInfo(info,extra,i);
@@ -129,22 +132,27 @@ function setStats(statValues,index) {
 function setOverallStats(statValues) {
   avgStat = 0;
   maxStat = 0;
+  maxIndex = 0;
   for (j=0; j < numNormalStats; j++) {
     normStat = statValues[j]/maxStatValue[j];
     if (normStat > 0)
       avgStat += normStat;
-    maxStat = Math.max(maxStat,normStat);
+    if (maxStat < normStat) {
+      maxStat = normStat;
+      maxIndex = j;
+    }
   }
   avgStat = avgStat/numNormalStats;
   maxStat = Math.min(1,maxStat);
   statValues[numNormalStats] = Math.floor(significance[numNormalStats]*avgStat)/significance[numNormalStats];
   statValues[numNormalStats+1] = Math.floor(significance[numNormalStats+1]*maxStat)/significance[numNormalStats+1];
+  return maxIndex;
 }
 
 function resetOverallStats() {
   for (i=0; i < numLive; i++) {
-    setOverallStats(allStats[i]);
-    extras[i] = extras[i] + ' avg: ' + allStats[i][numNormalStats] + ' max: ' + allStats[i][numNormalStats+1];
+    maxIndex = setOverallStats(allStats[i]);
+    extras[i] = extras[i] + '<br>\n&nbsp;&nbsp;avg: <strong>' + allStats[i][numNormalStats]
+ '</strong>&nbsp;&nbsp;max: <strong>' + allStats[i][numNormalStats+1]
+ '</strong> (' + statName[maxIndex] + ')';
   }
 }
 
@@ -209,7 +217,7 @@ function drawDots(){
       drawDot(x,y,Math.floor(dotSize[i]),getColor(getStat(i,colorStatType)));
   }
   if (mousedDot < numDots)
-    document.getElementById('vishoverinfo').innerHTML=ids[mousedDot]+extras[mousedDot];
+    document.getElementById('vishoverinfo').innerHTML='<strong>' + ids[mousedDot] +
'</strong>' + extras[mousedDot];
 }
 
 // fill in a few grey dots
@@ -360,7 +368,7 @@ function showId(e) {
   mousedDot = Math.floor(relx/(dotSpacing*2)) + width*Math.floor(rely/(dotSpacing*2));
   if (relx < (width*dotSpacing*2) && mousedDot < numDots) {
     document.getElementById('vishoverinfo').style.left=relx+canvas.offsetLeft;
-    document.getElementById('vishoverinfo').style.top=rely+canvas.offsetTop-40;
+    document.getElementById('vishoverinfo').style.top=Math.max(0,rely+canvas.offsetTop-70);
     document.getElementById('vishoverinfo').style.visibility='visible';
   }
   else {



Mime
View raw message