[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Statistics not working in ehcache-web Servlet filter  XML
Forum Index -> Ehcache
Author Message
fhisg

neo

Joined: 07/13/2011 02:24:10
Messages: 3
Offline

I setup a web cache that works properly. I debugged it and I see in the Ehcache debug log messages that my artifacts are indeed cached.
However, I don't get any statistics about this particular cache - for others I do get them.

Why?

ehcache.xml

Code:
  <cache name="imagesCache"
             maxElementsInMemory="1000"
             eternal="false"
             timeToIdleSeconds="120"
             timeToLiveSeconds="600"
             overflowToDisk="true"
             maxElementsOnDisk="100000"
             diskPersistent="false"
             diskExpiryThreadIntervalSeconds="120"
             memoryStoreEvictionPolicy="LRU"
             statistics="true" />


web.xml

Code:
  <!-- http://ehcache.org/documentation/web_caching.html -->
   <filter>
     <filter-name>ImagesCachingFilter</filter-name>
     <filter-class>net.sf.ehcache.constructs.web.filter.SimplePageCachingFilter</filter-class>
     <init-param>
       <param-name>suppressStackTraces</param-name>
       <param-value>false</param-value>
     </init-param>
     <init-param>
       <param-name>cacheName</param-name>
       <param-value>imagesCache</param-value>
     </init-param>
   </filter>
 
   <filter-mapping>
     <filter-name>ImagesCachingFilter</filter-name>
     <url-pattern>/image/*</url-pattern>
     <dispatcher>REQUEST</dispatcher>
   </filter-mapping>


Cheers,

http://www.frightanic.com
rajoshi

seraphim

Joined: 07/04/2011 04:36:10
Messages: 1491
Offline

HI ,

Intially seeing the configuration , the files looks ok to me , But it may be a configuration issue .Can you provide the logs , paste the code snippet and may be you want to share a little bit more of ehache.xml and web.xml , to see the configuration of the caches which you say are displaying the stats.

Rakesh Joshi
Senior Consultant
Terracotta.
fhisg

neo

Joined: 07/13/2011 02:24:10
Messages: 3
Offline

I gets more confusing the more I debug.
With the configuration shown in the OP I debugged the actual Ehcache cache object. I see that statistics seem to be collected* for this particular cache but the statistics MBean in the JMX console doesn't indicate that.
I see the statistics MBean in the JMX console for all my caches (all of them are exported) but for this cache, it's the only web cache btw, the statistics figures are all 0.0.

I'm lost...

* there's this one place that says something like "if (statisticsEnabled) { collectStatistics();}"

http://www.frightanic.com
 
Forum Index -> Ehcache
Go to:   
Powered by JForum 2.1.7 © JForum Team