You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ec...@apache.org on 2008/03/30 04:11:18 UTC
svn commit: r642659 - in
/geronimo/server/trunk/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
Author: ecraig
Date: Sat Mar 29 19:11:17 2008
New Revision: 642659
URL: http://svn.apache.org/viewvc?rev=642659&view=rev
Log:
GERONIMO-3937
java.lang.ArithmeticException: / by zero
Modified console to prevent passing of 0 in request
Modified:
geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java
geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp
geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp
Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java?rev=642659&r1=642658&r2=642659&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java (original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java Sat Mar 29 19:11:17 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/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp?rev=642659&r1=642658&r2=642659&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp (original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp Sat Mar 29 19:11:17 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/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp?rev=642659&r1=642658&r2=642659&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp (original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp Sat Mar 29 19:11:17 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')