Home
3.8.4 Monitoring MBeans statistics with wsadmin
Managed beans (MBeans) can be used to track statistics in the eXtreme scale environment. When eXtreme Scale is deployed with WebSphere Application Server, the wsadmin tool can be used perform the following tasks:
Get a reference to the eXtreme Scale MBeans using the AdminControl scripting object
Invoke the exposed operations on eXtreme Scale MBeans using AdminControl scripting object
Example 3-1 shows a code sample that accesses managed beans to get statistics for a cache instance. The sample was run using the wsadmin tool.
Example 3-1 Statistics using MBean
nodeSpecification = ",node=" + nodeName
queryString = "type=DynaCache,process=" + serverName + nodeSpecification + ",*"
mbean = AdminControl.queryNames(queryString)
cacheInstances = AdminControl.invoke(mbean,"getCacheInstanceNames").split(linesep)
stats = AdminControl.invoke(mbean, "getAllCacheStatistics", cacheInstance).split(linesep)
In the example the following variables were used:
nodeName is the node name where application is deployed
serverName is the sever name for which statistics are being collected
In our lab, we used a sample script called DynaCacheStatisticsCSV.py that collects cache statistics using MBeans and stores the data in a file as a comma-separated value (CSV) file. Example 3-2 shows how to use this script to collect cache statistics. The output of the script is a CSV file where data is written every ten seconds. We used baseCache as the cache instance, which is the default cache instance in WebSphere Application Server. You can modify this command according to the environment.
Obtaining the sample script: The DynaCacheStatisticsCSV.py script is available for download at:
http://github.com/kelapure/dynacache/blob/master/scripts/DynaCacheStatisticsCSV.py
Example 3-2 Dynacache statistics script
wsadmin -user wasadmin -password wasadmin -lang jython -f DynaCacheStatisticsCSV.py server1 dyna_cache.log "-cacheInstance baseCache -sleepUnit seconds -sleepInterval 10"
*sys-package-mgr*: processing modified jar, 'C:\Program Files\IBM\WebSphere\AppServer\lib\wsobjectgrid.jar'
*sys-package-mgr*: processing modified jar, 'C:\Program Files\IBM\WebSphere\AppServer\lib\wsogclient.jar'
WASX7209I: Connected to process "dmgr" on node deepkhanCellManager01 using SOAP connector; The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[server1, dy
na_out.log, -cacheInstance baseCache -sleepUnit seconds -sleepInterval 10]"
['-cacheInstance', 'baseCache', '-sleepUnit', 'seconds', '-sleepInterval', '10']
DEBUG INFO:
serverName= server1
version=
majorVersion=
minorVersion=
fileName= dyna_out.log
nodeName= thinkNode01
instanceName= baseCache
sleepUnit= seconds
sleepInterval= 10
sleepMilliseconds= 10000
fileAppend= false
instance: baseCache
The graphical presentation shown in Figure 3-19 was created using the CSV file output using the graphing capability of a spreadsheet. It shows substantial increase in cache hits after the data is available as cache entries.
Figure 3-19 Graphical presentation of cache statistics
Error 404 - Not Found Error 404 - Not Found
The document you are looking for may have been removed or re-named. Please contact the web site owner for further assistance.