[infinispan-dev] Adding getMBeanServer to AdvancedCache

Manik Surtani manik at jboss.org
Fri Dec 18 06:10:15 EST 2009


On 18 Dec 2009, at 08:27, Galder Zamarreno wrote:

> 
> 
> On 12/17/2009 07:08 PM, Manik Surtani wrote:
>> 
>> On 17 Dec 2009, at 14:49, Galder Zamarreno wrote:
>> 
>>> 
>>> 
>>> On 12/17/2009 03:08 PM, Manik Surtani wrote:
>>>> Isn't using JMX to gather this info a bit roundabout?  I mean, we are within the same VM at this stage anyway, and have a handle on the Cache itself...
>>> 
>>> Hmmm, I suppose that to get the information in CacheMgmtInterceptor, I
>>> could use cache.getAdvancedCache().getInterceptorChain() and find the
>>> CacheMgmtInterceptor to get stats information.
>> 
>> What info do you specifically need for the stats command?
> 
> http://github.com/trondn/memcached/blob/master/doc/protocol.txt
> 
> See "General-purpose statistics" section. Things like: uptime, version, 
> numbers of items currently stored, number of items stored since 
> Infinispan began...etc.

Hmm, a lot of this is very specific to a Unix daemon.  How useful and/or critical is it that we implement all of this?  My vote is that:

a)  We have a AdvancedCache.getStats() method, which returns Stats.
b)  Stats only contains a subset of the memcached statistics, that is already available and/or can be calculated *cheaply*
c)  Document which statistics we do support and which we don't

WDYT?

Cheers
Manik

> 
> Thinking about this again, perhaps trying to get access to this 
> information by retrieving the interceptor is probably not a nice way to 
> do it, since the interceptor is an inner component. Maybe Cache could 
> have getStats() that returns an immutable Stats object with the latest 
> values of the stats. That would decouple how we capture the stats 
> internally, to how they're retrieved from clients. Alternatively, if we 
> wanna decouple this, we already have JMX that acts as a decoupling 
> mechanism to accessing the stats.
> 
>> 
>>> 
>>> If you wanna simply get an interceptor like in this case, it might be
>>> easier if there was an API like:
>>> getInterceptor(Class<? extends CommandInterceptor>  type)
>>> 
>>> Looks to me getInterceptorChain() is particularly interesting when
>>> you're more interested in figuring out what interceptor might be before
>>> or after.
>>> 
>>>> 
>>>> 
>>>> On 17 Dec 2009, at 14:02, Galder Zamarreno wrote:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> For implementing the stats command in the memcached txt server, I'm
>>>>> planning to use JMX to get the relevant stats...etc. However, to make
>>>>> sure I hit the right MBeanServer, I thought of adding a getMBeanServer()
>>>>> to AdvancedCache that returns whatever MBeanServer has been used to
>>>>> register the MBeans. The MBeanServer actually comes from the
>>>>> corresponding MBeanServerLookup implementation.
>>>>> 
>>>>> Has anyone got any objections to this?
>>>>> --
>>>>> Galder Zamarreño
>>>>> Sr. Software Engineer
>>>>> Infinispan, JBoss Cache
>>>>> _______________________________________________
>>>>> infinispan-dev mailing list
>>>>> infinispan-dev at lists.jboss.org
>>>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>>> 
>>>> --
>>>> Manik Surtani
>>>> manik at jboss.org
>>>> Lead, Infinispan
>>>> Lead, JBoss Cache
>>>> http://www.infinispan.org
>>>> http://www.jbosscache.org
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> infinispan-dev mailing list
>>>> infinispan-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>> 
>>> --
>>> Galder Zamarreño
>>> Sr. Software Engineer
>>> Infinispan, JBoss Cache
>>> _______________________________________________
>>> infinispan-dev mailing list
>>> infinispan-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>> 
>> --
>> Manik Surtani
>> manik at jboss.org
>> Lead, Infinispan
>> Lead, JBoss Cache
>> http://www.infinispan.org
>> http://www.jbosscache.org
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> infinispan-dev mailing list
>> infinispan-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
> 
> -- 
> Galder Zamarreño
> Sr. Software Engineer
> Infinispan, JBoss Cache
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Manik Surtani
manik at jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org








More information about the infinispan-dev mailing list