📄 cache.jsp
字号:
<td align="center"><font size="-2" face="verdana"><b>OBJECTS</b></font></td> <td align="center"><font size="-2" face="verdana"><b>EFFECTIVENESS</b></font></td> <td align="center"><font size="-2" face="verdana"><b>CLEAR CACHE?</b></font></td> </tr><% // cache variables double memUsed; double totalMem; double freeMem; double hitPercent; long hits; long misses; // Loop through each cache, print out its info for (int i=0; i<caches.length; i++) { Cache cache = caches[i]; memUsed = (double)cache.getCacheSize()/(1024*1024); totalMem = (double)cache.getMaxCacheSize()/(1024*1024); freeMem = 100 - 100*memUsed/totalMem; hits = cache.getCacheHits(); misses = cache.getCacheMisses(); if (hits + misses == 0) { hitPercent = 0.0; } else { hitPercent = 100*(double)hits/(hits+misses); } boolean lowEffec = (hits > 500 && hitPercent < 85.0 && freeMem < 20.0);%> <tr bgcolor="#ffffff"> <td><font size="-1"><%= cache.getName() %></font></td> <td> <font size="-1"> <%= mbFormat.format(totalMem) %> MB, <font size="-2" face="verdana"> <%= percentFormat.format(freeMem)%>% free </font> </font> </td> <td align="center"> <font size="-1"> <%= LocaleUtils.getLocalizedNumber(cache.size(), JiveGlobals.getLocale()) %> </font> </td> <td> <font size="-1"> <% if (lowEffec) { %> <font color="#ff0000"><b><%= percentFormat.format(hitPercent)%>%</b></font> <% } else { %> <b><%= percentFormat.format(hitPercent)%>%</b> <% } %> (<%= LocaleUtils.getLocalizedNumber(hits, JiveGlobals.getLocale()) %> hits, <%= LocaleUtils.getLocalizedNumber(misses, JiveGlobals.getLocale()) %> misses) </font> </td> <td align="center"> <input type="checkbox" name="cacheID" value="<%= i %>"> </td> </tr><% } %> <tr bgcolor="#ffffff"> <td> </td> <td><input type="submit" name="editSizes" value="Edit Cache Sizes"></td> <td colspan="2"> </td> <td align="center"> <input type="submit" name="clearCache" value="Clear"> </td> </tr> </table> </td> </table></ul></form><p><% } %><font size="-1"><b>Cache Status</b></font><ul> <font size="-1"> You can enable or disable caching in the Jive system by using the form below. Disabling cache will severely degrade performance. </font><p> <form action="cache.jsp"> <input type="hidden" name="doCache" value="true"> <table bgcolor="<%= tblBorderColor %>" cellpadding="0" cellspacing="0" border="0" width="300"> <td> <table bgcolor="<%= tblBorderColor %>" cellpadding="3" cellspacing="1" border="0" width="100%"> <tr bgcolor="#ffffff"> <td align="center"<%= (cacheEnabled)?" bgcolor=\"#99cc99\"":"" %>> <font size="-1"> <input type="radio" name="cacheEnabled" value="true" id="rb01" <%= (cacheEnabled)?"checked":"" %>> <label for="rb01"><%= (cacheEnabled)?"<b>On</b>":"On" %></label> </font> </td> <td align="center"<%= (!cacheEnabled)?" bgcolor=\"#cc6666\"":"" %>> <font size="-1"> <input type="radio" name="cacheEnabled" value="false" id="rb02" <%= (!cacheEnabled)?"checked":"" %>> <label for="rb02"><%= (!cacheEnabled)?"<b>Off</b>":"Off" %></label> </font> </td> <td align="center"> <font size="-1"><input type="submit" value="Update"></font> </td> </tr> </table> </td> </table> </form></ul><p><% if (cacheEnabled && Version.EDITION == Version.Edition.ENTERPRISE) { %><font size="-1"><b>Short-term Query Cache</b></font><ul> <font size="-1"> Prevents cache expirations of the query cache from happening more than once every <%= (stqcLifetime/1000L) %> seconds. This is useful for sites with extreme amounts of traffic. The ramification to using the short-term query cache is that new content won't appear for <%= (stqcLifetime/1000L) %> seconds after it's posted. </font> <p></p> <form action="cache.jsp"> <table bgcolor="<%= tblBorderColor %>" cellpadding="0" cellspacing="0" border="0" width="300"> <td> <table bgcolor="<%= tblBorderColor %>" cellpadding="3" cellspacing="1" border="0" width="100%"> <tr bgcolor="#ffffff"> <td align="center"<%= (stqcEnabled)?" bgcolor=\"#99cc99\"":"" %>> <font size="-1"> <input type="radio" name="stqcEnabled" value="true" id="rb03" <%= (stqcEnabled)?"checked":"" %>> <label for="rb03"><%= (stqcEnabled)?"<b>On</b>":"On" %></label> </font> </td> <td align="center"<%= (!stqcEnabled)?" bgcolor=\"#cc6666\"":"" %>> <font size="-1"> <input type="radio" name="stqcEnabled" value="false" id="rb04" <%= (!stqcEnabled)?"checked":"" %>> <label for="rb04"><%= (!stqcEnabled)?"<b>Off</b>":"Off" %></label> </font> </td> <td align="center"> <input type="submit" value="Update" name="setStqcEnabled"> </td> </tr> </table> </td> </table> </form> <% if (stqcEnabled && Version.EDITION == Version.Edition.ENTERPRISE) { %> <form action="cache.jsp"> <table cellpadding="2" cellspacing="0" border="0"> <tr> <td rowspan="3" valign="top"> <font size="-1"> Cache Object Lifetime: </font> </td> <td><input type="radio" name="stqcLifetime" value="5000"<%= ((stqcLifetime==5000)?" checked":"") %> id="st01"></td> <td> <font size="-1"> <label for="st01">5 seconds (default)</label> </font> </td> </tr> <tr> <td><input type="radio" name="stqcLifetime" value="10000"<%= ((stqcLifetime==10000)?" checked":"") %> id="st02"></td> <td> <font size="-1"> <label for="st02">10 seconds</label> </font> </td> </tr> <tr> <td> </td> <td> <input type="submit" name="saveLifetime" value="Save"> </td> </tr> </table> </form> <% } %></ul><% } %><% if (cacheEnabled && Version.EDITION == Version.Edition.ENTERPRISE) { %><font size="-1"><b>Clustering</b></font><ul> <font size="-1"> You can enable or disable clustered caching in the Jive system by using the form below. (<b>Note</b>, enabling or disabling clustering requires an appserver restart.) <% if (promptForRestart) { %> <p> <i> Note, because your changed your cache policy, you must restart your appserver. The clustering status below will be incorrect until you restart. </i> <% } %> </font><p> <form action="cache.jsp" onsubmit="return confirm('Changing your caching policy requires an appserver restart.\n\nAre you sure you want to continue?');"> <table bgcolor="<%= tblBorderColor %>" cellpadding="0" cellspacing="0" border="0" width="300"> <td> <table bgcolor="<%= tblBorderColor %>" cellpadding="3" cellspacing="1" border="0" width="100%"> <tr bgcolor="#ffffff"> <td align="center"<%= (clusteringEnabled)?" bgcolor=\"#99cc99\"":"" %>> <font size="-1"> <input type="radio" name="clusteringEnabled" value="true" id="rb03" <%= (clusteringEnabled)?"checked":"" %>> <label for="rb03"><%= (clusteringEnabled)?"<b>On</b>":"On" %></label> </font> </td> <td align="center"<%= (!clusteringEnabled)?" bgcolor=\"#cc6666\"":"" %>> <font size="-1"> <input type="radio" name="clusteringEnabled" value="false" id="rb04" <%= (!clusteringEnabled)?"checked":"" %>> <label for="rb04"><%= (!clusteringEnabled)?"<b>Off</b>":"Off" %></label> </font> </td> <td align="center"> <input type="submit" value="Update" name="setClusteringEnabled"> </td> </tr> </table> </td> </table> </form> <p></ul><% } %><% if (cacheEnabled) { %><font size="-1"><b>Warmup Cache</b></font><ul> <font size="-1"> The cache warmup process will load your caches with the data that is most likely to accessed by users. This action is useful to perform when first starting a server, or after flushing the cache. However, it will put a heavy load on your database. <p> <form action="cache.jsp"> <input type="submit" name="warmupCache" value="Warmup Cache"> </form> </font></ul><p><% } %><font size="-1"><b>Java VM Memory</b></font><ul><% // The java runtime Runtime runtime = Runtime.getRuntime(); double freeMemory = (double)runtime.freeMemory()/(1024*1024); double totalMemory = (double)runtime.totalMemory()/(1024*1024); double usedMemory = totalMemory - freeMemory; double percentFree = ((double)freeMemory/(double)totalMemory)*100.0; int free = 100-(int)Math.round(percentFree);%> <table border=0> <tr><td><font size="-1">Used Memory:</font></td> <td><font size="-1"><%= mbFormat.format(usedMemory) %> MB</font></td> </tr> <tr><td><font size="-1">Total Memory:</font></td> <td><font size="-1"><%= mbFormat.format(totalMemory) %> MB</font></td> </tr> </table> <br> <table border=0><td> <table bgcolor="#000000" cellpadding="1" cellspacing="0" border="0" width="200" align=left> <td> <table bgcolor="#000000" cellpadding="1" cellspacing="1" border="0" width="100%"><% for (int i=0; i<NUM_BLOCKS; i++) { if ((i*(100/NUM_BLOCKS)) < free) { %> <td bgcolor="#00ff00" width="<%= (100/NUM_BLOCKS) %>%"><img src="images/blank.gif" width="1" height="15" border="0"></td><% } else { %> <td bgcolor="#006600" width="<%= (100/NUM_BLOCKS) %>%"><img src="images/blank.gif" width="1" height="15" border="0"></td><% } }%> </table> </td> </table></td><td> <font size="-1"> <b><%= percentFormat.format(percentFree) %>% free</b> </font> </td></table></ul><% // Destroy the runtime reference runtime = null;%><%@ include file="footer.jsp" %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -