Getting Client Group Statistics
The BrokerAdminClient.getClientGroupStats method lets you obtain statistics for a client group. The statistics are returned as fields within a BrokerEvent.
After you have obtained the BrokerEvent containing the statistics, you can retrieve each field using the BrokerEvent.get<type>Field method, described in the webMethods Broker Client Java API Programmer’s Guide. The version of the get<type>Field method to be used will depend on the data type of field you are retrieving. The following example illustrates how to obtain a BrokerEvent containing a client group's statistics and how to extract the value of two fields.
. . .
int events_published;
BrokerDate create_time;
BrokerEvent e;
BrokerAdminClient c;
try {
/* Create a Broker admin client */
c = new BrokerAdminClient(broker_host, broker_name, null,
client_group, "My Broker Monitor",null);
/* Get the BrokerEvent containing the client group statistics */
e = c.getClientGroupStats(“myGroup”);
/* Get the time and date when the client group was created */
create_time = e.getDateField( “createTime”);
/* Get the number of events published by all clients in this group */
events_published = e.getIntegerField( “numEventsPublished”);
. . .
} catch (BrokerException ex) {
System.out.println("Error while getting the client group statistics\n"+ex);
return;
}
. . .