geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r392639 - in /geronimo/branches/1.1/applications/console-standard/src: java/org/apache/geronimo/console/jsr77/DynamicServerInfo.java webapp/graphs/memoryGraphJS.jsp webapp/graphs/updatingGraphJS.jsp
Date Sun, 09 Apr 2006 00:22:18 GMT
Author: ammulder
Date: Sat Apr  8 17:22:16 2006
New Revision: 392639

URL: http://svn.apache.org/viewcvs?rev=392639&view=rev
Log:
Show a little more info, so we could dispense with the text values if we
  can figure out when the new stuff is visible

Modified:
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jsr77/DynamicServerInfo.java
    geronimo/branches/1.1/applications/console-standard/src/webapp/graphs/memoryGraphJS.jsp
    geronimo/branches/1.1/applications/console-standard/src/webapp/graphs/updatingGraphJS.jsp

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jsr77/DynamicServerInfo.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jsr77/DynamicServerInfo.java?rev=392639&r1=392638&r2=392639&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jsr77/DynamicServerInfo.java
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jsr77/DynamicServerInfo.java
Sat Apr  8 17:22:16 2006
@@ -37,7 +37,7 @@
     private String memoryMost;
     private String memoryAllocated;
     private String upTime;
-    private long bytesCurrent;
+    private long bytesCurrent, bytesMost, bytesAllocated;
 
     public DynamicServerInfo(long upTime) {
         this.upTime = calculateTime(upTime);
@@ -48,6 +48,8 @@
         dec2Format = NumberFormat.getNumberInstance();
         dec2Format.setMaximumFractionDigits(2);
         bytesCurrent = memoryCurrent;
+        bytesMost = memoryMost;
+        bytesAllocated = memoryAllocated;
         this.memoryCurrent = calculateMemory(memoryCurrent);
         this.memoryMost = calculateMemory(memoryMost);
         this.memoryAllocated = calculateMemory(memoryAllocated);
@@ -121,5 +123,13 @@
 
     public long getBytesCurrent() {
         return bytesCurrent;
+    }
+
+    public long getBytesMost() {
+        return bytesMost;
+    }
+
+    public long getBytesAllocated() {
+        return bytesAllocated;
     }
 }

Modified: geronimo/branches/1.1/applications/console-standard/src/webapp/graphs/memoryGraphJS.jsp
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/webapp/graphs/memoryGraphJS.jsp?rev=392639&r1=392638&r2=392639&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/webapp/graphs/memoryGraphJS.jsp
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/webapp/graphs/memoryGraphJS.jsp
Sat Apr  8 17:22:16 2006
@@ -1,16 +1,4 @@
 <%@ page contentType="text/javascript" %>
-var last = false;
-function addNext() {
-  if(last) {
-    addPoint(200);
-    last=false;
-  } else {
-    addPoint(50);
-    last=true;
-  }
-  setTimeout("addNext()", 500);
-}
-
 DWREngine.setErrorHandler(null);
 var stopped=false;
 function callServer() {
@@ -20,7 +8,9 @@
     Jsr77Stats.getJavaVMStatistics(metadata);
 }
 function updateValues(serverStats) {
-    addPoint(serverStats.bytesCurrent, serverStats.memoryCurrent);
+    setMaxValue(serverStats.bytesMost, serverStats.memoryMost);
+    addPoint(serverStats.bytesCurrent);
+    setLowerCaption("Using "+serverStats.memoryCurrent+" of "+serverStats.memoryAllocated+"
allocated");
     if(!stopped) {
         setTimeout("callServer()", 1000);
     }

Modified: geronimo/branches/1.1/applications/console-standard/src/webapp/graphs/updatingGraphJS.jsp
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/webapp/graphs/updatingGraphJS.jsp?rev=392639&r1=392638&r2=392639&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/webapp/graphs/updatingGraphJS.jsp
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/webapp/graphs/updatingGraphJS.jsp
Sat Apr  8 17:22:16 2006
@@ -28,6 +28,8 @@
 var yMax = 1;
 // Y Caption
 var yCaption = null;
+// Bottom Caption
+var lowerCaption = null;
 
 /** Saved bootstrap reference **/
 function initialize(evt, length, height, updater, caption) {
@@ -132,15 +134,39 @@
 }
 
 /** Adds a data point **/
-function addPoint(value, text) {
+function addPoint(value) {
   for(var i=0; i<data.length-1; i++) {
     data[i] = data[i+1];
   }
   data[data.length-1] = value
+  syncPoints();
+  setPathDef();
+}
+
+/** Ensures the Y axis is at least this large **/
+function checkMaxValue(value, text) {
   if(value > yMax) {
     yMax = value;
     yCaption.data = text;
   }
-  syncPoints();
-  setPathDef();
+}
+
+/** Sets the maximum Y value to the specified value **/
+function setMaxValue(value, text) {
+  yMax = value;
+  yCaption.data = text;
+}
+
+/** Sets the lower caption **/
+function setLowerCaption(text) {
+  if(lowerCaption == null) {
+    var caption = graphDocument.createElementNS(svgNS, "text");
+    caption.setAttribute("x", (xOffset+graphLength)/2);
+    caption.setAttribute("y", yOffset+graphHeight+30);
+    caption.setAttribute("text-anchor", "middle");
+    lowerCaption = graphDocument.createTextNode("   "+text+"   ");
+    caption.appendChild(lowerCaption);
+    graphGroup.appendChild(caption);
+  }
+  lowerCaption.data = "  "+text+"  ";
 }



Mime
View raw message