IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.stats
Interface StatsAccessor


public interface StatsAccessor

This interface is used to access StatsFact objects from the statistic repository and set the statistic specification for all in-process ObjectGrid instances.

Retrieve a StatsAccessor instance using the StatsAccessorFactory.getStatsAccessor() method

Setting the StatsSpec using the StatsAccessor only applies the stats specification to all ObjectGrid instances running in the current process (for example: currently allocated shards).

If the ObjectGrid is a distributed ObjectGrid, statistics specification can be set as follows:

StatsFact objects should only be used for local ObjectGrid instances or the client side (near cache) ObjectGrid instances. In a distributed environment, use the following mechanisms:

Since:
WAS XD 6.0.1
See Also:
StatsFact

Method Summary
 StatsFact getStatsFact(String[] paths, int moduleType)
          Retrieves the StatsFact object based on the path.
 StatsFact getStatsFact(String path, int moduleType)
          Retrieves the StatsFact object based on the path.
 StatsSpec getStatsSpec()
          Retrieves the StatsSpec defined for the process.
 void setStatsSpec(StatsSpec spec)
          Sets the StatsSpec for all the local ObjectGrid instances in this process.
 void setStatsSpec(String specString)
          Sets the StatsSpec for all the local ObjectGrid instances in this process.
 

Method Detail

setStatsSpec

void setStatsSpec(StatsSpec spec)
Sets the StatsSpec for all the local ObjectGrid instances in this process. The statistics specification defines the amount of statistics gathering the ObjectGrid is to perform.

The statistic specification is applied globally to the entire process and applies to all ObjectGrid and BackingMap instances when initialized. Instances that are already initialized will ignore any StatsSpec changes.

Parameters:
spec - the StatsSpec to be set
See Also:
StatsSpec

setStatsSpec

void setStatsSpec(String specString)
Sets the StatsSpec for all the local ObjectGrid instances in this process. The statistics specification defines the amount of statistics gathering the ObjectGrid is to perform.

The statistic specification is applied globally to the entire process and applies to all ObjectGrid and BackingMap instances when initialized. Instances that are already initialized will ignore any StatsSpec changes.

Parameters:
specString - the StatsSpec string to be set.
See Also:
StatsSpec

getStatsSpec

StatsSpec getStatsSpec()
Retrieves the StatsSpec defined for the process.

Returns:
the current StatsSpec setting for this process set using one of the setStatsSpec methods, or null if a setStatsSpec method has not been called

getStatsFact

StatsFact getStatsFact(String[] paths,
                       int moduleType)
Retrieves the StatsFact object based on the path. The path is specified as an array. The statistics module is then retrieved from the StatsFact.

The path array contains the path to the module. Each path array index is defined follows:

Dynamic Deployment Topology

Local, in-memory ObjectGrid or client

If the path array contains only a partial path, it will return an aggregated StatsModule for that level. For example, in a dynamic deployment topology:

 StatsFact sf = statsAccessor.getStatsFact(new String[]{"0", "root"}, StatsModule.MODULE_TYPE_OBJECT_GRID);
 OGStatsModule ogStats = (OGStatsModule) sf.getStatsModule();
 System.out.println(ogStats.toString());
 
will retrieve an OGStatsModule with statistics for all ObjectGrids for partition 0.

To limit the statistics scope to a single ObjectGrid, set additional arguments in the array. For example, in a dynamic deployment topology:

 StatsFact sf = statsAccessor.getStatsFact(new String[]{"0", "root", "BookstoreGrid"}, StatsModule.MODULE_TYPE_OBJECT_GRID);
 OGStatsModule ogStats = (OGStatsModule) sf.getStatsModule();
 System.out.println(ogStats.toString());
 
will retrieve an OGStatsModule with statistics for the "BookStore" ObjectGrid for partition 0.

Parameters:
paths - the array of paths to the module
moduleType - the module type defined in StatsModule
Returns:
the StatsFact object

getStatsFact

StatsFact getStatsFact(String path,
                       int moduleType)
Retrieves the StatsFact object based on the path. The path is defined using a forward slash ("/") delimited string. The statistics module is then retrieved from the StatsFact.

The path contains the path to the module. The path is defined as follows:

Dynamic Deployment Topology

Local, in-memory ObjectGrid or client

If the path array contains only a partial path, it will return an aggregated StatsModule for that level. For example, in a dynamic deployment topology:

 StatsFact sf = statsAccessor.getStatsFact("0/root", StatsModule.MODULE_TYPE_OBJECT_GRID);
 OGStatsModule ogStats = (OGStatsModule) sf.getStatsModule();
 System.out.println(ogStats.toString());
 
will retrieve an OGStatsModule with statistics for all ObjectGrids for partition 0.

To limit the statistics scope to a single ObjectGrid, set additional arguments in the array. For example, in a dynamic deployment topology:

 StatsFact sf = statsAccessor.getStatsFact("0/root/BookstoreGrid", StatsModule.MODULE_TYPE_OBJECT_GRID);
 OGStatsModule ogStats = (OGStatsModule) sf.getStatsModule();
 System.out.println(ogStats.toString());
 
will retrieve an OGStatsModule with statistics for the "BookStore" ObjectGrid for partition 0.

Parameters:
path - the path to the module
moduleType - the module type defined in StatsModule
Returns:
the StatsFact object

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

© Copyright International Business Machines Corp 2005,2012. All rights reserved.