IBM®
Skip to main content
    Country/region [select]      Terms of use
 
 
    
     Home      Products      Services & solutions      Support & downloads      My account     
 
developerworks > My developerWorks >  Dashboard > WebSphere eXtreme Scale V6.1 User Guide > ... > Monitoring applications > Administering with JMX MBean interfaces
developerWorks
Log In   View a printable version of the current page.
Overview Connect Spaces Forums Wikis
Administering with JMX MBean interfaces
Added by joshuad, last edited by Chris.D.Johnson on Feb 03, 2009  (view change)
Labels: 
(None)

Getting Started Examples Reference API documentation

See the WebSphere eXtreme Scale Wiki for links to eXtreme Scale Version 7.0 documentation.
If you log in with your developerWorks ID, you can leave comments and feedback for the development team.

ObjectGrid provides several different types of Java Management Extensions (JMX) MBeans to administer and monitor ObjectGrid deployments. Each MBean refers to a specific entity, such as a map, ObjectGrid, server, replication group, replication group member, and so on.

Each MBean in ObjectGrid has get methods that represent attribute values. These get methods cannot be called from a user program directly. The JMX specification treats attributes differently from operations. Attributes can be viewed through any third-party JMX console, and operations can be performed either through a user program or a third-party JMX console.

Statistics need to be enabled in order for the attributes to be recorded properly. Statistics can be enabled or defined as follows:

  • In a static deployment topology, statistics must be enabled in the ObjectGrid cluster XML at the cluster level with statisticsEnabled="true" and _statisticsSpec=<StatsSpec>
  • In a dynamic deployment topology, statistics can be enabled via the ServerProperties file with a key-value entry of statsSpec=<StatsSpec>
  • Statistics can also be programatically enabled via the StatsAccessor which is retrieved via the StatsAccessorFactory. This usage is best in a client environment or when it's necessary to monitor ObjectGrids that are running in the current process.

Here are some examples of possible <StatsSpec> settings:

  • To enable all statistics, substitute "all=enabled" where you see <StatsSpec> above, for example, statsSpec=all=enabled or statisticsSpec=all=enabled
  • To enable only ObjectGrid, substitute "og.all=enabled" where you see <StatsSpec> above

To see a description of all possible statistics specifications, see StatsSpec API documentation.

MapMBean MBean
Use the MapMBean MBean to monitor the statistics of each map that is defined. Each map has the following associated statistics:

  • Batch-update time (minimum, maximum, mean, and total)
  • Count
  • Hit rate

Because ObjectGrids and thus BackingMaps can be partitioned across servers, you can scope the Map statistics to a particular server, container or even partition. The query synopsis or template is in the form of:

com.ibm.websphere.objectgrid:type=ObjectMap,name=<mapName>,partition=<partition-id>,objectgrid=<objectgrid>,shardType=<primary|replica>,host=<host>,ogServerName=<server>

Some examples for querying the ObjectName include:

  • "com.ibm.websphere.objectgrid:type=ObjectMap,name=<mapName>"
  • "com.ibm.websphere.objectgrid:type=ObjectMap,name=<mapName>,partition=<partition-id>"
  • "com.ibm.websphere.objectgrid:type=ObjectMap,name=<mapName>,partition=<partition-id>,shardType=<primary|replica>"

Take an example configuration with an OG1 ObjectGrid, a Map1 map, and two servers in the topology, server1 and server2. Assume that the server1 server is a primary group member and the server2 server is a replica group member. To get the statistics for the Map1 map on the primary group member, use the following ObjectName query:

  • "com.ibm.websphere.objectgrid:type=ObjectMap,name=Map1,objectgrid=OG1,shardType=primary,ogServerName=server1"

A listing of the MapMBean interface follows:

public interface MapMBean {

    /**
     * Operation to get MapStatsModule associated with the MBean.
     * 
     * @return MapStatsModule
     */
    MapStatsModule retrieveStatsModule();

    /**
     * Operation will only go to server to get StatsModule if the
     * StatsModule is not cached in the ObjectGridAdministrator.
     * 
     */
    void refreshStatsModule();

    /**
     * Map.
     * 
     * @return name of map
     */
    String getMapName();

    /**
     * ObjectGrid containing the map.
     * 
     * @return name of the object grid
     */
    String getObjectGridName();

    /**
     * Server name of the replication group member for the map.
     * 
     * @return name of server of the replication group member
     */
    String getServerName();

    /**
     * Name of replication group for the map.
     * 
     * @return name of replication group
     */
    String getReplicationGroup();

    /**
     * Index of replication group member for the map.
     * 
     * @return index of replication group member
     */
    int getIndex();
    
    /**
     * MapStatsModule attribute loaded up by the 
     * retrieveStatsModule call.
     * 
     * @return String form of MapStatsModule
     */
    String getMapStatsModule();

    /**
     * Map count attribute loaded up by the 
     * retrieveStatsModule call.
     * 
     * @return number of entries in map
     */
    long getMapCountStatistic();

    /**
     * Hit rate attribute loaded up by the 
     * retrieveStatsModule call.
     * 
     * @return hit rate for map
     */
    double getMapHitRateStatistic();

    /**
     * Mean batch update time attribute loaded up by the 
     * retrieveStatsModule call.
     * 
     * @return mean batch update time for map
     */
    double getMapBatchUpdateMeanTime();

    /**
     * Maximum batch update time attribute loaded up by the 
     * retrieveStatsModule call.
     * 
     * @return maximum batch update time for map
     */
    double getMapBatchUpdateMaxTime();

    /**
     * Minimum batch update time attribute loaded up by the 
     * retrieveStatsModule call.
     * 
     * @return minimum batch update time for map
     */
    double getMapBatchUpdateMinTime();

    /**
     * Total batch update time attribute loaded up by the 
     * retrieveStatsModule call.
     * 
     * @return total batch update time for map
     */
    double getMapBatchUpdateTotalTime();
}

ObjectGridMBean MBean
Use the ObjectGridMBean MBean to monitor the statistics for all the maps in each ObjectGrid defined for the cluster. Each ObjectGrid has the following associated statistics:

  • Transaction time (minimum, maximum, mean, and total)
  • Count

Because ObjectGrids can be partitioned across servers, you can scope the ObjectGrid statistics to a particular server, container or even partition. The query synopsis or template is in the form of:

com.ibm.websphere.objectgrid:type=ObjectGrid,name=<grid>,partition=<partition-id>,objectgrid=<objectgrid>,shardType=<primary|replica>,host=<host>,ogServerName=<server>

Some examples for querying the ObjectName include:

  • "com.ibm.websphere.objectgrid:type=ObjectGrid,name=<grid>"
  • "com.ibm.websphere.objectgrid:type=ObjectGrid,name=<grid>,partition=<partition-id>"
  • "com.ibm.websphere.objectgrid:type=ObjectGrid,name=<grid>,partition=<partition-id>,shardType=<primary|replica>"

A listing of the ObjectGridMbean interface follows:

public interface ObjectGridMBean {

    /**
     * Operation to get OGStatsModule associated with the MBean.
     * 
     * @return OGStatsModule
     */
    OGStatsModule retrieveStatsModule();

    /**
     * Operation will only go to server to get StatsModule if the
     * StatsModule is not cached in the ObjectGridAdministrator.
     * 
     */
    void refreshStatsModule();

    /**
     * ObjectGrid.
     * 
     * @return name of the object grid
     */
    String getObjectGridName();

    /**
     * Server name of the replication group member for the ObjectGrid.
     * 
     * @return name of server of the replication group member
     */
    String getServerName();

    /**
     * Name of replication group for the ObjectGrid.
     * 
     * @return name of replication group
     */
    String getReplicationGroup();

    /**
     * Index of replication group member for the ObjectGrid.
     * 
     * @return index of replication group member
     */
    int getIndex();

    /**
     * OGStatsModule attribute loaded up by the retrieveStatsModule call.
     * 
     * @return String form of OGStatsModule
     */
    String getOGStatsModule();

    /**
     * ObjectGrid count attribute loaded up by the retrieveStatsModule call.
     * 
     * @return number of transactions
     */
    long getOGCount();

    /**
     * Maximum transaction time attribute loaded up by the retrieveStatsModule call.
     * 
     * @return maximum transaction time for the ObjectGrid
     */
    long getOGMaxTranTime();

    /**
     * Minimum transaction time attribute loaded up by the retrieveStatsModule call.
     * 
     * @return minimum transaction time for the ObjectGrid
     */
    long getOGMinTranTime();

    /**
     * Mean transaction time attribute loaded up by the retrieveStatsModule call.
     * 
     * @return mean transaction time for the ObjectGrid
     */
    double getOGMeanTranTime();

    /**
     * Total transaction time attribute loaded up by the retrieveStatsModule call.
     * 
     * @return total transaction time for the ObjectGrid
     */
    long getOGTotalTranTime();
}

DynamicServerMBean MBean
Use the ServerMBean MBean to perform operations on servers. The query synopsis or template is in the form of:

com.ibm.websphere.objectgrid:type=ObjectGridServer,name=<server>,host=<host>,ogServerName=<server>

Some examples for querying the ObjectName include:

  • "com.ibm.websphere.objectgrid:type=ObjectGridServer,name=<server>"
  • "com.ibm.websphere.objectgrid:type=ObjectGridServer,name=<server>,host=<host>"

A listing of the DynamicServerMBean interface follows:

public interface DynamicServerMBean extends ServerMBean {
    /**
     * @see Runtime#availableProcessors()
     * @return The answer from the Runtime call on the JVM hosting this server.
     */
    public int getAvailableProcessors();

    /**
     * @see Runtime#freeMemory()
     * @return The answer from the Runtime call on the JVM hosting this server.
     */
    public long getFreeMemory();

    /**
     * @see Runtime#maxMemory()
     * @return The answer from the Runtime call on the JVM hosting this server.
     */
    public long getMaxMemory();

    /**
     * @see Runtime#totalMemory()
     * @return The answer from the Runtime call on the JVM hosting this server.
     */
    public long getTotalMemory();

    /**
     * Returns the host name for this process.
     *
     * @see InetAddress#getHostName()
     * @return The answer from the Runtime call on the JVM hosting this server.
     */
    public String getHostName();

    /**
     * Returns the zone name for this process
     *
     * @return the zone name that was included in the properties used to start the server or
     * DefaultZone if no zone name was used
     */
    public String getZoneName();


    /**
     * Returns true if a replica exists for each primary hosted on this server.
     * Returns false if the server has the only copy of data.
     *
     * @return if server is safe to shutdown.
     */
    public boolean getSafeToShutdown();
}

The source code for the ServerMBean parent class:

public interface ServerMBean {

    /**
     * Gets the name of the server associated with this MBean.
     * 
     * @return the server name
     */
    public String getServerName();

    /**
     * Stops the server associated with this MBean.
     * 
     * @return <code>true</code> if server was stopped, 
     *         <code>false</code> if not
     * 
     * @see ObjectGridAdministrator#stopServer(String)
     */
    public boolean stopServer();

    /**
     * Modifies the trace spec for the server associated with this
     * MBean.
     * 
     * @param spec new trace specification
     * 
     * @see ObjectGridAdministrator#setServerTraceSpec(String, String)
     */
    public void modifyServerTraceSpec(String spec);

}

QueryManager MBean
Use the QueryManagerMBean to monitor the statistics for all queries executed within a particular ObjectGrid. Every ObjectGrid instance or partition will have a corresponding QueryManagerMBean associated with it. The statistics to be retrieved from this MBean are at the Query scope and therefore it is required that the query String be passed in for all operations.

Each QueryManagerMBean has the following associated statistics for a particular query String:

  • Query Run Time - The time it takes to run the query
  • Query Plan Creation Time - The time it takes to create the query plan
  • Run Count - The amount of times the query is run
  • Result Count - The count of the result for each query run
  • Failure Count - The number of times the query has failed

Because ObjectGrids can be partitioned across servers, you can scope the ObjectGrid statistics to a particular server, container or even partition. The query synopsis or template is in the form of:

com.ibm.websphere.objectgrid:type=QueryManager,name=<grid>,partition=<partition-id>,objectgrid=<objectgrid>,shardType=<primary|replica>,host=<host>,ogServerName=<server>

Some examples for querying the ObjectName include:

  • "com.ibm.websphere.objectgrid:type=QueryManager,name=<gridName>"
  • "com.ibm.websphere.objectgrid:type=QueryManager,name=<gridName>,partition=<partition-id>"
  • "com.ibm.websphere.objectgrid:type=QueryManager,name=<gridName>,partition=<partition-id>,shardType=<primary|replica>"

A listing of the ObjectGridMbean interface follows:

public interface QueryManagerMBean {

	/**
     * Gets the query's plan creation time attribute loaded up by the
     * <code>retrieveStatsModule()</code> method.
     *
     * @return the plan creation time for this query
     *
     * @see #retrieveStatsModule(String)
     * @see QueryStatsModule#getPlanCreationTime(boolean copy)
     */

	double getPlanCreationTime(String query);

	/**
     * Gets the query's run time attribute loaded up by the
     * <code>retrieveStatsModule()</code> method.
     *
     * @return the run time for this query
     *
     * @see #retrieveStatsModule(String)
     * @see QueryStatsModule#getQueryExecutionTime(boolean copy)
     */

	double getQueryExecutionTime(String query);

	/**
     * Gets the query's execution count attribute loaded up by the
     * <code>retrieveStatsModule()</code> method.
     *
     * @return the execution count for this query
     *
     * @see #retrieveStatsModule(String)
     * @see QueryStatsModule#getQueryExecutionCount(boolean copy)
     */

	double getQueryExecutionCount(String query);

	/**
     * Gets the query's result count attribute loaded up by the
     * <code>retrieveStatsModule()</code> method.
     *
     * @return the result count for this query
     *
     * @see #retrieveStatsModule(String)
     * @see QueryStatsModule#getQueryResultCount(boolean copy)
     */

	double getQueryResultCount(String query);

	/**
     * Gets the query's failure count attribute loaded up by the
     * <code>retrieveStatsModule()</code> method.
     *
     * @return the failure count for this query
     *
     * @see #retrieveStatsModule(String)
     * @see QueryStatsModule#getQueryFailureCount(boolean copy)
     */

	double getQueryFailureCount(String query);

	/**
     * Gets the <code>QueryStatsModule</code> used to retrieve statistics
     * associated with the specified query String
     *
     * @return an QueryStatsModule for statistics associated with the specified query String
     */

	QueryStatsModule retrieveStatsModule(String query);

}

AgentManager MBean
Use the AgentManagerMBean to monitor the statistics for all agents run on a particular BackingMap. Every BackingMap will have a corresponding AgentManagerMBean associated with it. The statistics to be retrieved from this MBean are at the agent scope. Thus, it is required that the agent's class name be passed in for all operations.

Each AgentManagerMBean has the following associated statistics for a particular agent's class-name:

  • Reduce Time - The total time it takes the agent to finish the reduce operation
  • Total Duration Time - The total time it takes for the agent to complete
  • Partition Count - The amount of partitions the agent is sent to
  • Agent Serialization Time - The amount of time it takes to serialize the agent
  • Result Inflation Time - The amount of time it takes to inflate the agent's results
  • Invocation Count - The number of times the AgentManager has been invoked
  • Failure Count - The number of times the agent failed
  • Agent Inflation Time - The amount of time it takes to inflate the agent on the server
  • Result Serialization Time - The amount of time it takes to serialize the agent's results

Because ObjectGrids can be partitioned across servers, you can scope the ObjectGrid statistics to a particular server, container or even partition. The query synopsis or template is in the form of:

com.ibm.websphere.objectgrid:type=AgentManager,name=Agent-<mapName>,partition=<partition-id>,objectgrid=<objectgrid>,shardType=<primary|replica>,host=<host>,ogServerName=<server>

Some examples for querying the ObjectName include:

  • "com.ibm.websphere.objectgrid:type=AgentManager,name=Agent-<mapName>"
  • "com.ibm.websphere.objectgrid:type=AgentManager,name=Agent-<mapName>,partition=<partition-id>"
  • "com.ibm.websphere.objectgrid:type=AgentManager,name=Agent-<mapName>,partition=<partition-id>,shardType=<primary|replica>"

A listing of the ObjectGridMbean interface follows:

public interface AgentManagerMBean {

	/**
     * Gets the specified agent's total reduce time attribute loaded up by the
     * <code>retrieveStatsModule()</code> method.
     *
     * @param agentClassName The fully qualified class name of the agent
     * @return the reduce time for this agent
     *
     * @see #retrieveStatsModule(String)
     * @see AgentStatsModule#getReduceTime(boolean copy)
     */

	double getReduceTime(String agentClassName);

	/**
     * Gets the specified agent's total run time attribute loaded up by the
     * <code>retrieveStatsModule()</code> method.
     *
     * @param agentClassName The fully qualified class name of the agent
     * @return the total run time for this agent
     *
     * @see #retrieveStatsModule(String)
     * @see AgentStatsModule#getTotalDurationTime(boolean copy)
     */

	double getTotalDurationTime(String agentClassName);

	/**
     * Gets the specified agent's serialization time attribute loaded up by the
     * <code>retrieveStatsModule()</code> method.
     *
     * @param agentClassName The fully qualified class name of the agent
     * @return the time it takes to serialize the agent
     *
     * @see #retrieveStatsModule(String)
     * @see AgentStatsModule#getAgentSerializationTime(boolean copy)
     */

	double getAgentSerializationTime(String agentClassName);

	/**
     * Gets the specified agent's inflation time attribute loaded up by the
     * <code>retrieveStatsModule()</code> method.
     *
     * @param agentClassName The fully qualified class name of the agent
     * @return the time it takes to inflate the agent
     *
     * @see #retrieveStatsModule(String)
     * @see AgentStatsModule#getAgentInflationTime(boolean copy)
     */

	double getAgentInflationTime(String agentClassName);

	/**
     * Gets the specified agent's result inflation time attribute loaded up by the
     * <code>retrieveStatsModule()</code> method.
     *
     * @param agentClassName The fully qualified class name of the agent
     * @return the time it takes to inflate the agent results for a given partition
     *
     * @see #retrieveStatsModule(String)
     * @see AgentStatsModule#getResultInflationTime(boolean copy)
     */

	double getResultInflationTime(String agentClassName);

	/**
     * Gets the specified agent's result serialization time attribute loaded up by the
     * <code>retrieveStatsModule()</code> method.
     *
     * @param agentClassName The fully qualified class name of the agent
     * @return the time it takes to serialize the agent results for a given partition
     *
     * @see #retrieveStatsModule(String)
     * @see AgentStatsModule#getResultSerializationTime(boolean copy)
     */

	double getResultSerializationTime(String agentClassName);

	/**
     * Gets the specified agent's partition count attribute loaded up by the
     * <code>retrieveStatsModule()</code> method.
     *
     * @param agentClassName The fully qualified class name of the agent
     * @return the number of partitions this agent is sent to
     *
     * @see #retrieveStatsModule(String)
     * @see AgentStatsModule#getPartitionCount(boolean copy)
     */

	double getPartitionCount(String agentClassName);

	/**
     * Gets the specified agent's failure count attribute loaded up by the
     * <code>retrieveStatsModule()</code> method.
     *
     * @param agentClassName The fully qualified class name of the agent
     * @return the failure count for the specified agent
     *
     * @see #retrieveStatsModule(String)
     * @see AgentStatsModule#getFailureCount(boolean copy)
     */

	double getFailureCount(String agentClassName);

	/**
     * Gets the specified agent's invocation count attribute loaded up by the
     * <code>retrieveStatsModule()</code> method.
     *
     * @param agentClassName The fully qualified class name of the agent
     * @return the invocation count for the specified agent
     *
     * @see #retrieveStatsModule(String)
     * @see AgentStatsModule#getInvocationCount(boolean copy)
     */

     double getInvocationCount(String agentClassName);

	/**
     * Gets the <code>AgentStatsModule</code> used to retrieve statistics
     * associated with the specified agent class
     *
     * @param agentClassName The fully qualified class name of the agent
     * @return an AgentStatsModule for statistics associated with the specified agent class
     *
     * @see AgentStatsModule
     */

     public AgentStatsModule retrieveStatsModule(String agentClassName);

}

HashIndex MBean
Use the HashIndexMBean to monitor the statistics for all indices that belong to a particular BackingMap. Every HashIndex instance that is registered with the BackingMap will have a corresponding HashIndexMBean associated with it.

Each HashIndexMBean has the following statistics associated with it:

  • Find Count - Index find invocation count
  • Find Duration Time - The amount of time the find operation takes to complete
  • Find Result Count - The number of keys returned from the find operation
  • Find Failure Count - The number of failures for the find operation
  • Find Collision Count - The amount of collisions for the find operation
  • Batch Update Count - The number of batch updates against this index

Because ObjectGrids can be partitioned across servers, you can scope the ObjectGrid statistics to a particular server, container or even partition. The query synopsis or template is in the form of:

com.ibm.websphere.objectgrid:type=HashIndex,name=<indexName>,partition=<partition-id>,objectgrid=<objectgrid>,shardType=<primary|replica>,host=<host>,ogServerName=<server>

Some examples for querying the ObjectName include:

  • "com.ibm.websphere.objectgrid:type=HashIndex,name=<indexName>"
  • "com.ibm.websphere.objectgrid:type=HashIndex,name=<indexName>,partition=<partition-id>"
  • "com.ibm.websphere.objectgrid:type=HashIndex,name=<indexName>,partition=<partition-id>,shardType=<primary|replica>"

A listing of the ObjectGridMbean interface follows:

public interface HashIndexMBean {

	/**
	 * Gets the index's parent map name
	 *
	 * @return the name of the map which this index belongs to
	 */

	String getParentMapName();

	/**
     * Gets the <code>HashIndexStatsModule</code> used to retrieve statistics
     * associated with this index
     *
     * @return an HashIndexStatsModule for statistics associated with this index
     *
     * @see HashIndexStatsModule
     */

	HashIndexStatsModule retrieveStatsModule();

	/**
     * Gets the index's find count attribute loaded up by the
     * <code>retrieveStatsModule()</code> method.
     *
     * @return the find operation's invocation count for this index
     *
     * @see #retrieveStatsModule()
     * @see HashIndexStatsModule#getFindCount(boolean copy)
     */

	double getFindCount();

	/**
     * Gets the index's find duration time attribute loaded up by the
     * <code>retrieveStatsModule()</code> method.
     *
     * @return the find call's duration time for this index
     *
     * @see #retrieveStatsModule()
     * @see HashIndexStatsModule#getFindDurationTime(boolean copy)
     */

	double getFindDurationTime();

	/**
     * Gets the index's result count attribute loaded up by the
     * <code>retrieveStatsModule()</code> method.
     *
     * @return the result count for this index and find operation
     *
     * @see #retrieveStatsModule()
     * @see HashIndexStatsModule#getFindResultCount(boolean copy)
     */

    double getFindResultCount();

	/**
     * Gets the index's failure count attribute loaded up by the
     * <code>retrieveStatsModule()</code> method.
     *
     * @return the failure count for this index and find operation
     *
     * @see #retrieveStatsModule()
     * @see HashIndexStatsModule#getFindFailureCount(boolean copy)
     */

    double getFindFailureCount();

	/**
     * Gets the index's collision count attribute loaded up by the
     * <code>retrieveStatsModule()</code> method.
     *
     * @return the collision count for this index and find operation
     *
     * @see #retrieveStatsModule()
     * @see HashIndexStatsModule#getFindCollisionCount(boolean copy)
     */

    double getFindCollisionCount();

	/**
     * Gets the index's batchupdate count attribute loaded up by the
     * <code>retrieveStatsModule()</code> method.
     *
     * @return the doBatchUpdate method's invocation count for this index
     *
     * @see #retrieveStatsModule()
     * @see MapIndexPlugin#doBatchUpdate(TxID txid, LogSequence sequence)
     * @see HashIndexStatsModule#getBatchUpdateCount(boolean copy)
     */

    double getBatchUpdateCount();

}

Related information

Wiki Disclaimer and License
© Copyright IBM Corporation 2007,2009. All Rights Reserved.


 
    About IBM Privacy Contact