Determining Available Engines with the Admin API

Determining Available Engines with the Admin API

book

Article ID: KB0090264

calendar_today

Updated On:

Products Versions
TIBCO DataSynapse GridServer -
Not Applicable -

Description

Resolution:
In order to get the number of Engines on the Grid, you could do the following, using the Java Admin API:

ManagerAdmin managerAdmin = AdminManager.getManagerAdmin();
System.out.println(managerAdmin.getEngineCount());  
// this will print out the total number of Engines on the Grid, including all Brokers.  This can only be called on a Director.

Alternatively, you could get the number of Engines for each Broker as such:

BrokerAdmin brokerAdmin = AdminManager.getBrokerAdmin();
BrokerInfo[] info = brokerAdmin.getAllBrokerInfo();
for (int i=0; i&ltinfo.length; i++) {
    System.out.println("Broker #" + i + " has " +
info[i].getEngineCount() + " Engines";  // the number of Engines on each Broker
}

You can also determine how many Drivers are logged into any particular Broker by using the BrokerInfo.getDriverCount() method. Normally, this is at least 1 (the internal Driver), but will be more when there are other Drivers logged in, presumably submitting work.

Issue/Introduction

Determining Available Engines with the Admin API