geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecr...@apache.org
Subject svn commit: r642673 - in /geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main: java/org/apache/geronimo/monitoring/console/GraphsBuilder.java webapp/WEB-INF/view/monitoringAddGraph.jsp webapp/WEB-INF/view/monitoringEditGraph.jsp
Date Sun, 30 Mar 2008 02:38:30 GMT
Author: ecraig
Date: Sat Mar 29 19:38:29 2008
New Revision: 642673

URL: http://svn.apache.org/viewvc?rev=642673&view=rev
Log:
GERONIMO-3937
java.lang.ArithmeticException: / by zero



Modified:
    geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java
    geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp
    geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp

Modified: geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java?rev=642673&r1=642672&r2=642673&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java
(original)
+++ geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java
Sat Mar 29 19:38:29 2008
@@ -91,11 +91,6 @@
                     throw e;
                 }
                 mrc = new MRCConnector(ip, username, password, port, protocol);
-                snapCount = timeFrame
-                        / java.lang.Integer
-                                .valueOf(java.lang.Long
-                                        .toString((mrc.getSnapshotDuration() / new Long(
-                                                60000))));
                 HashMap<String, ArrayList<Object>> DataList = new HashMap<String,
ArrayList<Object>>();
 
                 DataList.put(graphName1, new ArrayList<Object>());
@@ -106,12 +101,13 @@
                 if ((timeFrame / 1440 >= 30))
                     snapCount = 17;
                 else {
-                    if (((timeFrame / 1440) == 7) && ((timeFrame / 60) > 24)
-                            && snapCount >= 14) {
+                    if ((timeFrame / 1440) == 7) {
                         snapCount = 16;
-                    } else {
-                        snapCount = 12; // default for anything else
-                    }
+                    } else if ((int) ((timeFrame / (mrc.getSnapshotDuration() / 60000)))
<= 12)
+                        snapCount = (int) ((timeFrame / (mrc
+                                .getSnapshotDuration() / 60000)));
+                    else
+                        snapCount = 12;
                 }
 
                 ArrayList<Object> snapshot_time = new ArrayList<Object>();
@@ -133,7 +129,8 @@
                 }
 
                 int skipCount = (int) ((timeFrame / (mrc.getSnapshotDuration() / 60000)))
-                        / (snapCount - 2);
+                        / (snapCount);
+
                 snapCount = snapCount + 2;
                 TreeMap<Long, Long> snapshotList1 = mrc
                         .getSpecificStatistics(mBeanName, dataName1, snapCount,

Modified: geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp?rev=642673&r1=642672&r2=642673&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp
(original)
+++ geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp
Sat Mar 29 19:38:29 2008
@@ -147,7 +147,7 @@
    }
    // ensure that the timeframe is at least 2*(snapshotduration)
    if(duration * 2 > document.addGraph.timeframe.value) {
-       alert("Snapshot Duration needs to be at least " + 2 * duration);
+       alert("Timeframe needs to be at least " + 2 * duration);
        return false;
    }
    if (document.addGraph.operation.value == 'other')

Modified: geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp?rev=642673&r1=642672&r2=642673&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp
(original)
+++ geronimo/server/branches/2.1/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp
Sat Mar 29 19:38:29 2008
@@ -171,7 +171,7 @@
    }
    // ensure that the timeframe is at least 2*(snapshotduration)
    if(duration * 2 > document.editGraph.timeframe.value) {
-        alert("Snapshot Duration needs to be at least " + 2 * duration);
+        alert("Timeframe needs to be at least " + 2 * duration);
         return false;
    }
    if (document.editGraph.operation.value == 'other')



Mime
View raw message