tele4.tcl
Cache Viewer
- Location:
- /packages/acs-subsite/www/admin/system/tele4.tcl
Related Files
[ hide source ] | [ make this the default ]
File Contents
ad_page_contract { Cache Viewer } { {cache:optional 0} {item:optional 0} {flush:optional 0} } # Expires: now ns_set update [ns_conn outputheaders] "Expires" "now" set output " <html> <head> <title>AOLserver Telemetry</title> <STYLE> BODY { background: #ffffff; font-family: helvetica; font-size: 10pt; } H1 { font-family: helvetica; font-size: 18pt; } H2 { font-family: helvetica; font-size: 16pt; } H3 { font-family: helvetica; font-size: 14pt; } TD { background: cyan; font-family: helvetica; font-size: 8pt; } PRE { font-family: helvetica; font-size: 10pt; } FORM { font-family: helvetica; font-size: 8pt; } </STYLE> </head> <body>" if { $flush != 0 } { tlf::flush_cache $cache $flush } if { $cache == 0 } { append output "<h3>Memory Caches</h3> <blockquote> <table> <tr> <td align=left valign=top><b>name</b></td> <td align=left valign=top><b>stats</b></td> <td align=left valign=top><b>size</b></td> </tr>" foreach item [lsort [ns_cache_names]] { append output "<tr><td align=left valign=top><a href='?cache=$item'>$item</a></td>" append output "<td align=left valign=top>[oacs::ns_cache_stats $item] </td>" append output "<td align=left valign=top>[lindex [ns_cache_size $item] 1] </td></tr>" } append output "</table>" } elseif { $item != 0 } { append output "<h3>Data for cache_item $item of cache $cache</h3>" append output "<p><xmp>[ns_cache get $cache $item]</xmp></p>" } else { set item_list [ns_cache names $cache] set item_count [llength $item_list] append output "<h3>Items in cache $cache ($item_count) with size [ns_cache_size $cache]</h3><ul>" foreach name [lsort -dictionary $item_list] { append output "<li><a href='?cache=$cache&item=$name'>$name</a> (<a href='?cache=$cache&flush=$name'>flush</a>)</li>" } append output "</ul>" } ns_return 200 "text/html" $output