Author: jonesde
Date: Mon Apr 30 23:54:48 2007
New Revision: 533951
URL:
http://svn.apache.org/viewvc?view=rev&rev=533951Log:
Small changes to use FastList/Map and to use a TreeSet to sort the entries rather than them appearing in random order
Modified:
ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/stats/StatsSinceStart.bsh
Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/stats/StatsSinceStart.bsh
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/stats/StatsSinceStart.bsh?view=diff&rev=533951&r1=533950&r2=533951==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/stats/StatsSinceStart.bsh (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/stats/StatsSinceStart.bsh Mon Apr 30 23:54:48 2007
@@ -22,6 +22,8 @@
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.security.Security;
import org.ofbiz.webapp.stats.*;
+import javolution.util.FastList;
+import javolution.util.FastMap;
String clearBins = request.getParameter("clear");
if (UtilValidate.isNotEmpty(clearBins) && "true".equals(clearBin)) {
@@ -31,11 +33,11 @@
}
// Requests
-Iterator iterator = UtilMisc.toIterator(ServerHitBin.requestSinceStarted.keySet());
-if(iterator!=null && iterator.hasNext()){
- List requestList = new ArrayList();
+Iterator iterator = UtilMisc.toIterator(new TreeSet(ServerHitBin.requestSinceStarted.keySet()));
+if(iterator != null && iterator.hasNext()){
+ List requestList = FastList.newInstance();
while(iterator.hasNext()){
- Map requestIdMap = new HashMap();
+ Map requestIdMap = FastMap.newInstance();
String statsId = (String)iterator.next();
ServerHitBin bin = (ServerHitBin) ServerHitBin.requestSinceStarted.get(statsId);
if (bin != null) {
@@ -56,11 +58,11 @@
}
// Events
-iterator = UtilMisc.toIterator(ServerHitBin.eventSinceStarted.keySet());
-if(iterator!=null && iterator.hasNext()){
- List eventList = new ArrayList();
+iterator = UtilMisc.toIterator(new TreeSet(ServerHitBin.eventSinceStarted.keySet()));
+if(iterator != null && iterator.hasNext()){
+ List eventList = FastList.newInstance();
while(iterator.hasNext()){
- Map requestIdMap = new HashMap();
+ Map requestIdMap = FastMap.newInstance();
String statsId = (String)iterator.next();
ServerHitBin bin = (ServerHitBin) ServerHitBin.requestSinceStarted.get(statsId);
if (bin != null) {
@@ -81,11 +83,11 @@
}
// Views
-iterator = UtilMisc.toIterator(ServerHitBin.viewSinceStarted.keySet());
-if(iterator!=null && iterator.hasNext()){
- List viewList = new ArrayList();
+iterator = UtilMisc.toIterator(new TreeSet(ServerHitBin.viewSinceStarted.keySet()));
+if(iterator != null && iterator.hasNext()){
+ List viewList = FastList.newInstance();
while(iterator.hasNext()){
- Map requestIdMap = new HashMap();
+ Map requestIdMap = FastMap.newInstance();
String statsId = (String)iterator.next();
ServerHitBin bin = (ServerHitBin) ServerHitBin.requestSinceStarted.get(statsId);
if (bin != null) {