com.ibm.websphere.pmi.stat
Interface WSStats
-
public interface WSStatsWebSphere Performance Monitoring Infrastructure (PMI) Stats interface. This interface is similar tojavax.management.j2ee.statistics.Statsinterface. There are two ways to access stats:- via MBean stats attribute
- via WebSphere Perf MBean
javax.management.j2ee.statistics.Statswill be returned. If the MBean has a specific stats interface defined in the J2EE specification then an object of that specific type will be returned. For example, if the target MBean type is JVM then the return type will bejavax.management.j2ee.statistics.JVMStats.When using the Perf MBean an object of type
com.ibm.websphere.pmi.stat.WSStatswill be returned. The Perf MBean doesn't provide support for specific stats interface like JVMStats. The following example explains how to get the individual statistic from WSStat interface.ObjectName perfMBean; // get Perf MBean (MBean type=Perf) String query = "WebSphere:type=perf,node=" + nodeName + ",process=" + serverName + ",*"; ObjectName queryName = new ObjectName(query); Set s = adminClient.queryNames(queryName, null); if (!s.isEmpty()) perfMBean = (ObjectName)s.iterator().next(); ObjectName jvmMBean; // get JVM MBean in the same way as above with type JVM(MBean type=JVM) // invoke getStatsObject on perfMBean signature = new String[] {"javax.management.ObjectName","java.lang.Boolean"}; params = new Object[] {jvmMBean, new Boolean(false)}; WSStats jvmStats = (WSStats) ac.invoke(perfMBean, "getStatsObject", params, signature); // get JVM Heap size. //WebSphere Performance Monitoring Infrastructure (PMI) maintains the Stats from various components in a tree structure. Refer to the Perf MBean documentation for details about Perf MBean API.WSJVMStatsinterface defines all the statistics that are available from JVM WSRangeStatistic jvmHeapStatistic = (WSRangeStatistic) jvmStats.getStatistic (WSJVMStats.HeapSize); long heapSize = jvmHeapStatistic.getCurrent(); // print all statistics System.out.println (jvmStats.toString());
-
-
Method Summary
Methods Modifier and Type Method and Description intgetLevel()Deprecated.No replacementjava.lang.StringgetName()Returns the Stats name (eg., JVM Runtime, Thread Pools)WSStatisticgetStatistic(int id)Get Statistic by ID.WSStatisticgetStatistic(java.lang.String statisticName)Get Statistic by Name.java.lang.String[]getStatisticNames()Get Statistic namesWSStatistic[]getStatistics()Get all statisticsWSStatsgetStats(java.lang.String name)Get the sub-module stats by the namejava.lang.StringgetStatsType()Returns the Stats type (eg., jvmRuntimeModule, threadPoolModule).WSStats[]getSubStats()Get all the sub-module statslonggetTime()Returns the time when the client request came to the serverintgetType()Deprecated.No replacementjava.lang.String[]listStatisticNames()Deprecated.As of 6.0, replaced bygetStatisticNames()WSStatistic[]listStatistics()Deprecated.As of 6.0, replaced bygetStatistics()WSStats[]listSubStats()Deprecated.As of 6.0, replaced bygetSubStats()intnumStatistics()Returns the number of statistics available in this Stats object (this number doesn't include the sub-module stats).voidresetOnClient(boolean recursive)Reset the statistic (the statistic is reset only in the client side and not in the server side).voidsetConfig(PmiModuleConfig config)Set textual information.java.lang.StringtoString()Returns the Stats in String formatjava.lang.StringtoXML()Returns the Stats in XML formatvoidupdate(WSStats newStats, boolean keepOld, boolean recursiveUpdate)Update the Stats object
-
-
-
Method Detail
-
getName
java.lang.String getName()
Returns the Stats name (eg., JVM Runtime, Thread Pools)
-
getStatsType
java.lang.String getStatsType()
Returns the Stats type (eg., jvmRuntimeModule, threadPoolModule). This type is used to bind the text information like name, description and unit to the Stats.
-
getTime
long getTime()
Returns the time when the client request came to the server
-
setConfig
void setConfig(PmiModuleConfig config)
Set textual information. If the text information like name, description, and unit are null then this method can be used to bind the text information to the Stats. The text information will be set by default.- See Also:
WSStatsHelper
-
getStatistic
WSStatistic getStatistic(int id)
Get Statistic by ID. The IDs are defined incom.ibm.websphere.pmi.stat.WS*Statsinterface.
-
getStatistic
WSStatistic getStatistic(java.lang.String statisticName)
Get Statistic by Name.
-
getStatisticNames
java.lang.String[] getStatisticNames()
Get Statistic names
-
getStatistics
WSStatistic[] getStatistics()
Get all statistics
-
getStats
WSStats getStats(java.lang.String name)
Get the sub-module stats by the name
-
getSubStats
WSStats[] getSubStats()
Get all the sub-module stats
-
numStatistics
int numStatistics()
Returns the number of statistics available in this Stats object (this number doesn't include the sub-module stats).
-
listStatistics
WSStatistic[] listStatistics()
Deprecated. As of 6.0, replaced bygetStatistics()Returns all the statistics
-
listSubStats
WSStats[] listSubStats()
Deprecated. As of 6.0, replaced bygetSubStats()Returns all the sub-module statistics
-
listStatisticNames
java.lang.String[] listStatisticNames()
Deprecated. As of 6.0, replaced bygetStatisticNames()Returns all the statistic names
-
update
void update(WSStats newStats, boolean keepOld, boolean recursiveUpdate)
Update the Stats object- Parameters:
newStats- the new value of the StatskeepOld- indicates if the the statistics/subStats that are not in newStats should be removedrecursiveUpdate- recursively update the sub-module stats when it is true
-
resetOnClient
void resetOnClient(boolean recursive)
Reset the statistic (the statistic is reset only in the client side and not in the server side).
-
toXML
java.lang.String toXML()
Returns the Stats in XML format
-
toString
java.lang.String toString()
Returns the Stats in String format- Overrides:
toStringin classjava.lang.Object
-
getType
int getType()
Deprecated. No replacementReturns the PMI collection type
-
getLevel
int getLevel()
Deprecated. No replacementReturns the PMI instrumentation level
-
-