Monitoring server statistics with managed beans (MBeans)
You can used managed beans (MBeans) to track statistics in your environment.
Before you begin
For the attributes to be recorded, you must enable statistics. You can enable statistics on the server, or enable HTTP session statistics to track attributes on your client application. For more information on how to enable HTTP session statistics, see xref.
You can enable statistics in one of the following ways:
- With the server properties file:You can enable statistics in the server properties file with a key-value entry of
statsSpec=<StatsSpec>
. Some examples of possible settings follow:- To enable all statistics, use
statsSpec=all=enabled
- To enable only ObjectGrid statistics, use
statsSpec=og.all=enabled
. To see a description of all possible statistics specifications, see the StatsSpec API.
- To enable all statistics, use
- With a managed bean:
You can enable statistics using the StatsSpec attribute on the ObjectGrid MBean. For more information, see the StatsSpec API.
- Programmatically:
You can also enable statistics programmatically with the StatsAccessor interface, which is retrieved with the StatsAccessorFactory class. Use this interface in a client environment or when you need to monitor a data grid that is running in the current process.