Hello list,

With XWiki 3.1 I had managed following the below instructions to use:
> MBeanServer server = ManagementFactory.getPlatformMBeanServer();
> def mbeanEv = new GroovyMBean(server, 
> 'jboss.cache:service=JBossCache,uniqueId=32dcce09,jmx-resource=CacheMgmtInterceptor')
> println("mbeanEv: " + mbeanEv + ", enabled: " + mbeanEv.StatisticsEnabled);
> println("evictions amount: " + mbeanEv.Evictions);
> println("hits amount: " + mbeanEv.Hits);

where the uniqueId was obtained by listing before.

But now that we use XWiki 3.5, I need to do it with Infinispan and it seems a 
little bit more complex... something close to my lack of competency of mixing 
Groovy and JMX:
 
I can do this:

for(def mbean in server.queryMBeans(new ObjectName("org.infinispan:*"),null)) {
            out.println("<hr>");
            out.println("name : " + mbean.getObjectName());
            GroovyMBean mb = new GroovyMBean(server, mbean.getObjectName());
            out.println("mb: " + mb);
}

which does show me the things I can see in JConsole, including an evictionRate 
for some of the caches.
But I do not manage to"
- filter the objects that have a statistics
-  extract this statistics.

Hints welcome.

paul

>>> The big annoyance with this process is that it can only run on our 
>>> production server. So thus far I did not dare register a CacheListener in 
>>> groovy fearing it would suddenly be slow.
>>> 
>>> Has anyone used a different strategy or tool?
>>> I'm happy to post my little monitor script.
>> 
>> FYI, newer versions of XE uses JBoss as the default cache implementation. 
>> And JBoss offers JMX support.
>> 
>> Thus you can get all sort of cache stats using JMX.
> 
> Thanks Vincent,
> 
> I knew a better core meant a better xwiki!
> 
> Now, Ludovic convinced me that it was possible to upgrade the core and it 
> starts to work: running the "old" gui of curriki.org (called curriki8) on 
> xwiki core 3.2. This is quite exciting.
> 
> I've explored:
>       http://extensions.xwiki.org/xwiki/bin/view/Extension/JMX+Access
> which tastes right like I need it.
> 
> But I am not sure to bridge the gap to obtain the information for the cache.
> 
> I do not see how to port to the world above what I see at:
>       
> http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Monitoring#HXWikiCachesMonitoring

_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to