By default MC4J is able to monitor only attributes exposed in the mbean's interfaces... sooo, the only graph statistics you can get are the of the attributes you can see with the jmx-console.
In general, it's up to each individual developer what they expose in terms of management attributes.
The MBeans for Entity Bean containers contain a getCacheSize method that returns an integer. This would be ideal for plotting in MC4J, except that this method is exposed as an operation rather than attribute.
Any reason we shouldn't patch this MBean to use CacheSize as an attribute?
I see no reason why not but I'm not responsible of that piece of code. Which MBean is this, a JSR-77 one?
I don't believe this is JSR-77. The declaration is:
public class EntityContainer
implements ContainerInvokerContainer, InstancePoolContainer, StatisticsProvider
I don't see any references to J2EEManagedObject.
The relevant code is where it creates the MBeanInfo:
"Get the Container cache size.",
(Later, a handler exists in invoke(...) to process the method.)
So I believe I just have to replace this code to create an MBeanAttributeInfo, and create an implementation of getAttribute(...) to handle it, and we are good to go, yes?
Patch submitted to Sourceforge.
Thanks! This was very quick. I am impressed :-) I will try to apply the patch...