|
IBM WebSphere Application ServerTM Release 8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WSStats
WebSphere Performance Monitoring Infrastructure (PMI) Stats interface. This interface is similar to javax.management.j2ee.statistics.Stats
interface.
There are two ways to access stats:
javax.management.j2ee.statistics.Stats
will 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 be javax.management.j2ee.statistics.JVMStats
.
When using the Perf MBean an object of type com.ibm.websphere.pmi.stat.WSStats
will 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.
// WSJVMStats
interface 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());
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.
Method Summary | |
---|---|
int |
getLevel()
Deprecated. No replacement |
java.lang.String |
getName()
Returns the Stats name (eg., JVM Runtime, Thread Pools) |
WSStatistic |
getStatistic(int id)
Get Statistic by ID. |
WSStatistic |
getStatistic(java.lang.String statisticName)
Get Statistic by Name. |
java.lang.String[] |
getStatisticNames()
Get Statistic names |
WSStatistic[] |
getStatistics()
Get all statistics |
WSStats |
getStats(java.lang.String name)
Get the sub-module stats by the name |
java.lang.String |
getStatsType()
Returns the Stats type (eg., jvmRuntimeModule, threadPoolModule). |
WSStats[] |
getSubStats()
Get all the sub-module stats |
long |
getTime()
Returns the time when the client request came to the server |
int |
getType()
Deprecated. No replacement |
java.lang.String[] |
listStatisticNames()
Deprecated. As of 6.0, replaced by getStatisticNames() |
WSStatistic[] |
listStatistics()
Deprecated. As of 6.0, replaced by getStatistics() |
WSStats[] |
listSubStats()
Deprecated. As of 6.0, replaced by getSubStats() |
int |
numStatistics()
Returns the number of statistics available in this Stats object (this number doesn't include the sub-module stats). |
void |
resetOnClient(boolean recursive)
Reset the statistic (the statistic is reset only in the client side and not in the server side). |
void |
setConfig(PmiModuleConfig config)
Set textual information. |
java.lang.String |
toString()
Returns the Stats in String format |
java.lang.String |
toXML()
Returns the Stats in XML format |
void |
update(WSStats newStats,
boolean keepOld,
boolean recursiveUpdate)
Update the Stats object |
Method Detail |
---|
java.lang.String getName()
java.lang.String getStatsType()
long getTime()
void setConfig(PmiModuleConfig config)
WSStatsHelper
WSStatistic getStatistic(int id)
com.ibm.websphere.pmi.stat.WS*Stats
interface.
WSStatistic getStatistic(java.lang.String statisticName)
java.lang.String[] getStatisticNames()
WSStatistic[] getStatistics()
WSStats getStats(java.lang.String name)
WSStats[] getSubStats()
int numStatistics()
WSStatistic[] listStatistics()
getStatistics()
WSStats[] listSubStats()
getSubStats()
java.lang.String[] listStatisticNames()
getStatisticNames()
void update(WSStats newStats, boolean keepOld, boolean recursiveUpdate)
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 truevoid resetOnClient(boolean recursive)
java.lang.String toXML()
java.lang.String toString()
toString
in class java.lang.Object
int getType()
int getLevel()
|
IBM WebSphere Application ServerTM Release 8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |