public class GbjJmxCacheStatsMonitor extends Object
GbjJmxCacheStatsMonitor operates like statmonitor, gathering samples of the associated stone/cache's cache statistics at a regular sampling rate. But instead of writing them to a file, it instead organizes them as a collection of GbjJmxCacheStats (an extension of JMX's DynamicMBeans) that are accessible to JMX applications. In addition, it provides a way to execute short GS Smalltalk code snippets for performing basic system management tasks. To do so, it starts up an optional gem process (called the "control session" below) to execute the GS Smalltalk code.
unix> rmigistry <portNumber>
To execute the GbjJmxCacheStatsMonitor, do the following:
java -d64 com.gemstone.gbjstats.GbjJmxCacheStatsMonitor <portNumber> [args]
where:
portNumber: | A valid unused port on this machine |
(Must have rmiregistry <portNumber> in effect) | |
args: | |
-h | -- print help text |
-s <stone> | -- Stone name |
(defaults to gs64stone) | |
-u <user> | -- GemStone user for control session |
if not supplied, control session is not started | |
(User will be prompted for password) | |
-g <gemnetid> | -- GemNetId |
(defaults to gemnetobject) | |
-i <interval> | -- Sampling interval in milliseconds |
(defaults to 1000) |
In addition, GbjJmxCacheStatsMonitor can also be used in conjunction with the VMware Hyperic system monitoring tool. In this case, an additional argument must be added to the command line:
java -d64 -Dinstallpath=<JDK directory> com.gemstone.gbjstats.GbjJmxCacheStatsMonitor...
Where <JDK directory> is the directory containing the JDK installation on this machine.
There are two domains defined by GbjJmxCacheStatsMonitor:
| GemStone | for basic cache stat information for all GemStone processes, and |
| Gemstone/Hyperic | for a more complex layout designed for access from VMware's Hyperic system monitoring tool. |
For the GemStone domain, the JMX registered object name format is:
| GemStone | (The Domain) |
| stone | The name of the stone |
| process | A particular GemStone process |
GemStone/Hyperic stats are available at two different levels: A summary "System" level and a "Process" level similar to the "GemStone" stats defined above. The format used for System-level GemStone/Hyperic stats is as follows:
| GemStone/Hyperic | (The Domain) |
| version | The GemStone version of the stone being monitored |
| stone | The name of the stone |
Process-level GemStone/Hyperic stats extend from the System-level format as follows:
| GemStone/Hyperic | (The Domain) |
| version | The GemStone version of the stone being monitored |
| stone | The name of the stone |
| ptype | The type of GS process: stone, shpcmon, pgsvr, gem |
| process | The GS process |
The actual System-level cache stats displayed are configurable by the user, using a template file that will be described later.
By default, there are no Process-level GemStone/Hyperic stats displayed. These need to be manually activated by the user via the "enableHypericTracing" command (described below).
Working with a JMX monitoring application, you can navigate through these hierarchies to find the GS process of interest. Once you reach this level, you can either display attributes or execute commands. In the jconsole tool, you can display attributes by selecting the "Attributes" tab in the tool.
For Process-level statistics, there are three command available:
| stop | -- Stop the process using the GS Smalltalk stopSession command. |
| kill | -- Kill the process using the OS-level "kill -9" command. |
| enableHypericTrace | -- enable tracing of this process under the GemStone/Hyperic domain. |
For GemStone/Hyperic System-level statistics, the available commands are configurable by the user. By default, the following are available:
Any statistic from either the stone or the shared page cache monitor may be listed. GbjJmxCacheStatsMonitor will first check for a stat by that name in the stone, and if not found will then look for that stat in the shared page cache monitor.
public static void main(String[] args)