<%@ page import="org.jivesoftware.util.cache.Cache"%> <%@ page import="org.jivesoftware.util.ParamUtils"%> <%@ page import="java.text.DecimalFormat"%> <%-- - $RCSfile$ - $Revision: $ - $Date: $ - - Copyright (C) 2005-2008 Jive Software. All rights reserved. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. --%> <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %> <% webManager.init(request, response, session, application, out ); %> <fmt:message key="system.cache.title"/> <% // Get parameters boolean doClearCache = request.getParameter("clear") != null; int refresh = ParamUtils.getIntParameter(request, "refresh", -1); int[] cacheIDs = ParamUtils.getIntParameters(request, "cacheID", -1); // Get the list of existing caches Cache[] caches = webManager.getCaches(); // Clear one or multiple caches if requested. if (doClearCache) { for (int cacheID : cacheIDs) { caches[cacheID].clear(); } } // decimal formatter for cache values DecimalFormat mbFormat = new DecimalFormat("#0.00"); DecimalFormat percentFormat = new DecimalFormat("#0.0"); percentFormat.setNegativePrefix(""); %> <% if (doClearCache) { %>

<% } %>

<% // cache variables double overallTotal = 0.0; double memUsed; double totalMem; double freeMem; double usedMem; String hitPercent; long hits; long misses; %>
<% // Loop through each cache, print out its info for (int i=0; i 500 && hitValue < 85.0 && freeMem < 20.0); } %> "> <% } %>
<%= cache.getName() %>
<% if (cache.getMaxCacheSize() != -1 && cache.getMaxCacheSize() != Integer.MAX_VALUE) { %> <%= mbFormat.format(totalMem) %> MB <% } else { %> <% } %> <%= mbFormat.format(memUsed)%> MB <% if (cache.getMaxCacheSize() != -1 && cache.getMaxCacheSize() != Integer.MAX_VALUE) { %> <%= percentFormat.format(usedMem)%>% <% } else { %> N/A <% } %> <%= hitPercent%>
<%= mbFormat.format(overallTotal/(1024.0*1024.0)) %> MB " disabled>