Use org.apache.jcs.admin.JCSAdminBean

Ie.

     JCSAdminBean jcsBean = new org.apache.jcs.admin.JCSAdminBean();

      java.util.LinkedList aList = jcsBean.buildCacheInfo();

      Iterator it = aList.iterator();
      while(it.hasNext())
      {
        CacheRegionInfo record = (CacheRegionInfo) it.next();

  
        record.getCache().getCacheName();
        record.getByteCount();         <-----  bytes in the cache
        record.getStatus();
        record.getCache().getSize();  <-----  Number of items in the
cache
        record.getCache()
            .getHitCountRam();
        record.getCache()
            .getHitCountAux();
        record.getCache()
            .getMissCountNotFound();
        record.getCache()
            .getMissCountExpired();

      }

Hope this helps, 

Jeremy

-----Original Message-----
From: Zsolt Varszegi [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 21, 2007 3:12 AM
To: JCS Users List
Subject: RE: size of memory cache in bytes

(Sigh..) I was afraid you would say this. I thought about this option
but felt was a bit troublesome. But if there is no other easier way I
guess I will have to go ahead with this. 

Thanks very much for taking the time to answer though.

Regards, 

Zsolt 

-----Original Message-----
From: Ard Schrijvers [mailto:[EMAIL PROTECTED]
Sent: 20 March 2007 21:47
To: JCS Users List
Subject: RE: size of memory cache in bytes

Hello,

> 
> Hi,
>  
> I would like to know if it is possible to query the size of the memory

> cache in bytes (as opposed to number of objects)?

isn't this always very hard in java? The cache can't know which kind of
objects you are storing, so how could it know how large it is? If all
your object are serializable, you could estimate the size but you have
to implement this yourself AFAIK

Regards Ard

>  
> - If yes can this be done on the group level or only on region level?
>  
> - If no what would be a(n easy) solution in your opinion if we still 
> would like to do it?
>  
> Regards,
>  
> Zsolt
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



The information contained in this message and any accompanying attachments may 
contain privileged, private and/or confidential information protected by state 
and federal law.  Penalties may be assessed for unauthorized use and/or 
disclosure.  This message and any attachments are intended for the designated 
recipient only.  If you have received this information in error, please notify 
the sender immediately and return or destroy the information.

This e-mail transmission and any attachments are believed to have been sent 
free of any virus or other defect that might affect any computer system into 
which it is received and opened. It is, however, the recipient's responsibility 
to ensure that the e-mail transmission and any attachments are virus free, and 
the sender accepts no responsibility for any damage that may in any way arise 
from their use.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to