Java Caching System - finding map size -


i'm using java caching system (jcs - https://commons.apache.org/proper/commons-jcs/ ) need find size of cache (from class org.apache.commons.jcs.access.cacheaccess)

with cacheaccess.getstats() can string gives me stats of cache

e.g.

string stats = ((icacheaccess<string, book>) cache).getstats(); 

and give me lots of info

region name = bookcache hitcountram = 0 hitcountaux = 0 ---------------------------memory cache list size = 5015 map size = 5015 put count = 5015 hit count = 0 miss count = 0 ---------------------------indexed disk cache alive = true key map size = 0 data file length = 0 hit count = 0 bytes free = 0 optimize operation count = 0 times optimized = 0 recycle count = 0 recycle bin size = 0 startup size = 0 purgatory hits = 0 purgatory size = 0 working = true alive = false empty = true size = 0 

but need map or list size.

any ideas - other regex :-)

you can try

list<istatelement> stats = ((icacheaccess<string, book>) cache).getstatistics().getstatselements(); // using collectionsutil commons-collection collectionsutil.select(stats, new predicate<istatelement>() {     public boolean evaluate(istatelement elem) {         string name = elem.getname();         return "list size".equals(name) || "map size".equals(name);     } });  

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -