<%@ page import="java.io.*" %> <%@ page import="java.util.*" %> <%@ page import="java.text.SimpleDateFormat" %> <%@ page import="com.hof.util.*" %> <%@ page import="com.hof.mi.gis.util.*" %> <%@ page import="com.hof.mi.olap.*" %> <%@ page import="com.hof.mi.util.*" %> <% if (request.getParameter("action")!=null) { String action = request.getParameter("action"); if ("DATACACHE".equals(action)) { ReportDataCache.instance().clear(); out.write("Data Cache Cleared"); } if ("REPORTCACHE".equals(action)) { ReportDefinitionCache.getInstance().clear(); out.write("Report Cache Cleared"); } if ("DASHBOARDCACHE".equals(action)) { DashboardDefinitionCache.getInstance().clear(); out.write("Dashboard Cache Cleared"); } if ("VIEWCACHE".equals(action)) { ViewCache.getInstance().clear(); out.write("View Cache Cleared"); } if ("CACHEDCACHE".equals(action)) { CachedFilterCache.getInstance().emptyCache(); out.write("CachedFilter Cache Cleared"); } if ("GEOCACHE".equals(action)) { GeometryCache.getInstance().clearCache(); out.write("Geometry Cache Cleared"); } if ("TRANSLATECACHE".equals(action)) { TranslationCache.clear(); out.write("Translation Cache Cleared"); } if ("LDAPCACHE".equals(action)) { LDAPUtil.getDNCache().clear(); out.write("LDAP Cache Cleared"); } } %>

Report Data Cache:

<% ReportDataCache rdc = ReportDataCache.instance(); %> <% for (KeyValuePair kvp: rdc.getCacheStats()) { %> <% } %>
Cache Max Size: <%=rdc.getCacheSize()%>
<%=UtilString.xmlEscape(kvp.getKey(), false)%> <%=UtilString.xmlEscape(kvp.getValue().toString(), false)%>

Clear

Report Definition Cache:

<% ReportDefinitionCache rddc = ReportDefinitionCache.getInstance(); %> <% for (KeyValuePair kvp: rddc.getCacheStats()) { %> <% } %>
Cache Current Size: <%=rddc.getCurrentSize()%>
Cache Max Size: <%=rddc.getSize()%>
Cache Max Age: <%=rddc.getMaxAge()%>
<%=UtilString.xmlEscape(kvp.getKey(), false)%> <%=UtilString.xmlEscape(kvp.getValue().toString(), false)%>

Clear

Dashboard Definition Cache:

<% DashboardDefinitionCache dddc = DashboardDefinitionCache.getInstance(); %> <% for (KeyValuePair kvp: dddc.getCacheStats()) { %> <% } %>
Cache Current Size: <%=dddc.getCurrentSize()%>
Cache Max Size: <%=dddc.getSize()%>
Cache Max Age: <%=dddc.getMaxAge()%>
<%=UtilString.xmlEscape(kvp.getKey(), false)%> <%=UtilString.xmlEscape(kvp.getValue().toString(), false)%>

Clear

Document Cache:

<% DocumentCache dc = DocumentCache.getInstance(); %> <% for (KeyValuePair kvp: dc.getCacheStats()) { %> <% } %>
Cache Current Size: <%=dc.getCurrentSize()%>
Cache Max Size: <%=dc.getSize()%>
Cache Max Age: <%=dc.getMaxAge()%>
<%=UtilString.xmlEscape(kvp.getKey(), false)%> <%=UtilString.xmlEscape(kvp.getValue().toString(), false)%>

Person Cache:

<% PersonCache pc = PersonCache.getInstance(); %> <% for (KeyValuePair kvp: pc.getCacheStats()) { %> <% } %>
Cache Current Size: <%=pc.getCurrentSize()%>
Cache Max Size: <%=pc.getSize()%>
Cache Max Age: <%=pc.getMaxAge()%>
<%=UtilString.xmlEscape(kvp.getKey(), false)%> <%=UtilString.xmlEscape(kvp.getValue().toString(), false)%>

Cached Filter Cache:

<% CachedFilterCache cfc = CachedFilterCache.getInstance(); %> <% for (KeyValuePair kvp: cfc.getCachedFilterMapStats()) { %> <% } %> <% for (KeyValuePair kvp: cfc.getCachedFilterQueryMapStats()) { %> <% } %> <% for (KeyValuePair kvp: cfc.getMetaFilterMapStats()) { %> <% } %>
Cache Settings
Cache Method <%=cfc.getCacheMethod().toString()%>
Join Method <%=cfc.getJoinMethod().toString()%>
Cached Filter Cache
Cached Filters maximum size: <%=cfc.getCachedFilterMapMaxSize()%>
Cached Filters caching period: <%=cfc.getCachedFilterMapTimeout()%>
<%=UtilString.xmlEscape(kvp.getKey(), false)%> <%=UtilString.xmlEscape(kvp.getValue().toString(), false)%>
View Level Filter Items: <%=cfc.getViewLevelCachedFilterMapSize()%>
Cached Filter Query Cache
Cached Query Filters maximum size: <%=cfc.getCachedFilterQueryMapMaxSize()%>
Cached Query Filters caching period: <%=cfc.getCachedFilterQueryMapTimeout()%>
<%=UtilString.xmlEscape(kvp.getKey(), false)%> <%=UtilString.xmlEscape(kvp.getValue().toString(), false)%>
Filter Meta Data Cache
Filter Meta Data Cache maximum size: <%=cfc.getMetaFilterMapMaxSize()%>
Filter Meta Data caching period: <%=cfc.getMetaFilterMapTimeout()%>
<%=UtilString.xmlEscape(kvp.getKey(), false)%> <%=UtilString.xmlEscape(kvp.getValue().toString(), false)%>

Clear

View Cache:

<% ViewCache vc = ViewCache.getInstance(); %>
ReportView records currently cached: <%=vc.getReportViewMapSize()%>

Clear

Geometry Cache:

<% GeometryCache gc = GeometryCache.getInstance(); %>
Max cache size: <%=gc.getMaxCacheSize()%>
Geometry elements currently cached: <%=gc.getCurrentCacheSize()%>

Clear

Report Thumbnail Cache:

<% ReportThumbnailCache rtc = ReportThumbnailCache.instance(); %>
Max cache size: <%=rtc.getMaxCacheSize()%>
Thumbnails currently cached: <%=rtc.getCurrentCacheSize()%>

Image Cache:

<% ImageCache ic = ImageCache.getInstance(); %>
Images cached: <%=ic.getNumberOfImagesCached()%>
Bytes cached: <%=ic.getTotalBytesCached()%> / <%=ic.getMaxBytesCached()%>

Translation Cache:

<% for (KeyValuePair kvp: TranslationCache.getCacheStats()) { %> <% } %>
Max Cache Size: <%=TranslationCache.getCacheSize()%>
Max age: <%=timeString(TranslationCache.getMaxAge())%>
<%=UtilString.xmlEscape(kvp.getKey(), false)%>: <%=UtilString.xmlEscape(kvp.getValue(), false)%>

Clear

LDAP DN Cache:

<% LRUCache lc = LDAPUtil.getDNCache(); %> <% for (KeyValuePair kvp: lc.getCacheStats()) { %> <% } %>
Max Cache Size: <%=lc.getCacheSize()%>
Max age: <%=timeString(lc.getMaxAge())%>
<%=UtilString.xmlEscape(kvp.getKey(), false)%>: <%=UtilString.xmlEscape(kvp.getValue().toString(), false)%>

Clear

<% OrgCache oc = OrgCache.getInstance(); String str = oc.getOrgParm(Const.UNO, "OLAPMEMBERCACHEENABLED"); if (Boolean.parseBoolean(str)) { OlapMemberCache omc = OlapMemberCache.getInstance(); String strategy = oc.getOrgParm(Const.UNO, "OLAPMEMBERCACHESTRATEGY"); %>

OLAP Member Cache:

<% for (KeyValuePair kvp: omc.getCacheStats()) { %> <% } %>
Cache Strategy: <% if ("MDX".equals(strategy)) { %> MDX <% } else { %> Metadata <% } %>
Cache Max Size: <%=omc.getCacheSize()%>
Cache Max Age: <%=timeString(omc.getMaxAge())%>
<%=UtilString.xmlEscape(kvp.getKey(), false)%> <%=UtilString.xmlEscape(kvp.getValue(), false)%>
<% } %>

Event Cache:

<% Map map = EventCache.getInstance().getStatistics(); List list = (List)map.get("DateRangesLoaded"); int hits = (Integer)map.get("CacheHits"); int misses = (Integer)map.get("CacheMisses"); int maxCount = (Integer)map.get("MaxEventCount"); int numEvents = (Integer)map.get("NumEventsCached"); %>
Max Cache Size: <%=maxCount%>
Events cached: <%=numEvents%> <% if (maxCount > 0) { %> (<%=(numEvents * 100 / maxCount)%>%) <% } %>
Cache hits: <%=hits%> <% if (hits > 0 || misses > 0) { %> (<%=(hits * 100 / (hits + misses))%>%) <% } %>
Cache misses: <%=misses%> <% if (hits > 0 || misses > 0) { %> (<%=(misses * 100 / (hits + misses))%>%) <% } %>
Date ranges cached (GMT): <% SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); sdf.setTimeZone(TimeZone.getTimeZone("GMT")); for (EventCache.DateRange range: list) { %> <%=sdf.format(i4DateTime.getAsCalendar(range.getStart(), "GMT").getTime())%> - <% if (range.getEnd() == null) { %> now <% } else { %> <%=sdf.format(i4DateTime.getAsCalendar(range.getEnd(), "GMT").getTime())%> <% } %>
<% } %>
Bytes used: <%=EventCache.getInstance().getRoughSizeOfCache()%>

Text Entity Cache:

<% TextEntityCache tc = TextEntityCache.getInstance(); %> <% for (KeyValuePair kvp: tc.getCacheStats()) { %> <% } %>
Cache Current Size: <%=tc.getCurrentSize()%>
Cache Max Size: <%=tc.getSize()%>
Cache Max Age: <%=tc.getMaxAge()%>
<%=UtilString.xmlEscape(kvp.getKey(), false)%> <%=UtilString.xmlEscape(kvp.getValue().toString(), false)%>
<%! private String timeString(long millis) { StringBuilder buf = new StringBuilder(); buf.append(millis).append("ms"); if (millis > 1000) { long sec = millis / 1000; if (sec < 60) { buf.append(" (").append(sec).append(" seconds)"); } else { long min = sec / 60; sec = sec % 60; if (min < 60) { buf.append(" (").append(min).append(" mins"); if (sec > 0) { buf.append(", ").append(sec).append(" seconds"); } buf.append(")"); } else { long hour = min / 60; min = min % 60; buf.append(" (").append(hour).append(" hrs"); if (min > 0 || sec > 0) { buf.append(", ").append(min).append(" mins"); if (sec > 0) { buf.append(", ").append(sec).append(" seconds"); } } buf.append(")"); } } } return buf.toString(); } %>