<%! /********************************************************************** ** ** SAP AG Walldorf ** (C) Copyright SAP AG 1999-2010 ** ***********************************************************************/ #include "publicincl/http_subhdl.inc" struct icm_cache_status { boolean active; string csize; string csize_used; int max_entries; int centries; int max_ufo; int ufo_entr; int noreq_total; int noreq_cache; int nohits; int nomisses; int noreq_ufo; int nohits_ufo; int nohits_mem; int noswaps; }; struct icm_cache_entry { boolean valid; int dsize; int version; string exp_time; string crea_time; string last_acc; string filename; string name; }; %> <% struct icm_http_subhdl icm_subhdl_tab[]; struct icm_cache_status icm_cache_stat; struct icm_cache_entry icm_cache_tab[]; string browser, lastControlID; string hdlsel, tabsel, formfld, ref, cache_name; float hits, misses, hitsmem, ftmp; int page_no, i, nr, rc; int count = 0; boolean is_admin; string tab_hdlsel[]; string tab_header[2]; string tab_content[2]; string tab_tabsel[2]; tab_header[0] = "Settings"; tab_header[1] = "Cache Contents"; tab_tabsel[0] = "tab0"; tab_tabsel[1] = "tab1"; browser = __icm_get_browser_type(); lastControlID = htmlenc(__icm_get_form_field ("lastControlID")); count = __icm_http_hdl (2,icm_subhdl_tab,4); for (i = 0; i < count; i++) { tab_hdlsel[i] = ""; } is_admin = __icm_get_system_property ("is_admin"); hdlsel = anumenc(__icm_get_form_field ("hdlsel")); if (hdlsel != "") tab_hdlsel[hdlsel] = "selected"; tabsel = anumenc(__icm_get_form_field ("tabsel")); if (tabsel == "") tabsel = "tab0"; if (tabsel == "tab0") { __icm_cache_hdl (1, hdlsel, icm_cache_stat); } %> Server Cache Status
<% if (icm_cache_stat.active) { %>
Deactivate Handler

Close Menu
<% } else { %>
Activate Handler

Close Menu
<% } %>
HTTP Server Cache Monitor for     Refresh

<% for (nr = 0; nr < 2; nr++) { %> <% } %>
class="sapTbsTabSel"> <%=tab_header[nr]%> <% } else { %> class="sapTbsTab"> <%=tab_header[nr]%> <% } %>
<% if (tabsel == "tab0") { rc = __icm_cache_hdl (1, hdlsel, icm_cache_stat); if (rc == -1) { %>
No information available
<% } else { if (icm_cache_stat.noreq_cache > 0) { ftmp = icm_cache_stat.nohits; hits = ftmp * 100.0 / icm_cache_stat.noreq_cache; misses = 100.0 - hits; } else { hits = 0.0; misses = 0.0; } if (icm_cache_stat.noreq_cache > 0) { ftmp = icm_cache_stat.nohits_mem; hitsmem = ftmp * 100.0 / icm_cache_stat.noreq_cache; } else { hitsmem = 0.0; } %>
Settings for HTTP Server Cache
Cache Handler Status <% if (icm_cache_stat.active) { if (is_admin) { __output("active"); __output(" "); } else { __output("active"); } __output(" \"green\""); } else { if (is_admin) { __output("inactive"); __output(" "); } else { __output("inactive"); } __output(" \"red\""); } %>  
Cache Sizes
Cache Size (Bytes) <%= icm_cache_stat.csize %>  
Occupied Cache Memory (Bytes) <%= icm_cache_stat.csize_used %>  
Cache Entries
Maximum Number of Cache Entries <%= icm_cache_stat.max_entries %>  
Current Number of Cache Entries <%= icm_cache_stat.centries %>  
Number of displaced Cache Entries <%= icm_cache_stat.noswaps %>  
Cache access statistic
Total Number of Cache Accesses <%= icm_cache_stat.noreq_total %>  
Number of Cachable Accesses <%= icm_cache_stat.noreq_cache %>  
Number of cache hits <%= icm_cache_stat.nohits %> <%=hits%>%
Number of cache misses <%= icm_cache_stat.nomisses %> <%=misses%>%
Number of cache hits in memory cache <%= icm_cache_stat.nohits_mem %> <%=hitsmem%>%
Unfound Object (UFO) Cache
Number of Accesses to UFO List <%= icm_cache_stat.noreq_ufo %>  
Number of UFO Hits <%= icm_cache_stat.nohits_ufo %>  
<% } } else { count = __icm_cache_hdl (2, hdlsel, icm_cache_tab); %> <% for (nr = 0; nr < count; nr++) { ref = htmlenc(strtok(icm_cache_tab[nr].name, "&")); cache_name = htmlenc(icm_cache_tab[nr].name); %> <% if (icm_cache_tab[nr].valid) { %> <% } else { %> <% } %> <% } if (count > 100) { %>
Cache Entries Invalidate Cache
No. Valid Cache Entry Size  Creation time Valid until Version
<%= nr %>ValidInvalid <%= cache_name %> <%= icm_cache_tab[nr].dsize %>  <%= icm_cache_tab[nr].crea_time %> <%= icm_cache_tab[nr].exp_time %> <%= icm_cache_tab[nr].version %>
Cache Entries Invalidate Cache
<% } } %>