The statistics Java API enables a Java-based client application to request statistics.
The ctgstats.jar file can be used in isolation for standalone monitoring applications. ctgstats.jar is compatible with ctgclient.jar provided both jar files are from the same version of CICS TG. Mixing ctgstats.jar and ctgclient.jar that are from different versions of CICS TG is not supported.
The Java API classes are responsible for connecting and making statistical requests to a statistics port provided by the Gateway daemon. The constructors allow the destination to be supplied by the application.
The statistic resource groups are available through the getResourceGroupIds method. An IdResultSet object is returned that contains a collection of IdData objects that hold the names of the resource groups. You can iterate over the IdResultSet to search the resource groups available.
If the names of the available statistics are required use the getStatIds method. This method returns an IdResultSet, functioning the same as getResourceGroupIds.
You can retrieve actual statistic values using the getStats method. This method returns a StatResultSet object that contains a collection of StatData objects. These StatData objects contain both the statistic names, and their current values. You can iterate over the StatResultSet to search the statistics available from the request.
If a result set returned has the return code set you can map this to the reason using the getReturnString method of the ResponseData class.You can enable statistics API tracing programmatically using the Java tracing options, see Tracing in Java client programs. Java API errors are reported to the calling application.