Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

Logging Client-Server Commands

Logging Client-Server Commands

StarTeam is a multi-tier client-server system. In general, SDK calls result in commands issued to the server over a proprietary Tcp/Ip based command streaming protocol.

When developing SDK based custom applications, a valuable principle to adhere to is - a few commands with large bursts of data transmitted is far superior to large sets of commands each transmitting small packets of data. This approach is called bulkification. 

Chatty applications typically consume significant amounts of network bandwidth, in the process, bogging the client down in Tcp/Ip traffic. But, bulkification is as important to the StarTeam server as it is to the client. Every time the server receives a command from a client, it allocates a thread to handle that command. The thread has to receive the data driving the request, process the request, possibly issue a database query, return the results to the client, then return the thread to the thread pool ready to service the next request. Each thread allocated to a client application is potential starvation of another client application waiting for a server thread.

Well behaved SDK applications minimize the number of commands issued, while maximizing client side memory retention and processing.

The best way to track exactly what commands are issued by the custom application, and to use this information to bulkify the application and minimize the commands, is to log all commands using the NetMonitor class. Each command issued fires an event to registered callers, through the ServerCommandListener event interface. NetMinitor is used to turn on the registration.

Here is a simple example...

public class ServerCommandAdapter implements ServerCommandListener {

               public void start(ServerCommandEvent e) {

System.out.print(e.getCommandName() + " " + e.isPropertyFetchTriggered());

               }

               public void end(ServerCommandEvent e) {

System.out.println(e.getCommandTime() + " " + e.getBytesSent() + " " + e.getBytesReceived());

               }

               public void error(ServerCommandEvent e) {

System.out.println("Error:" + e.getCommandName());

               }

}

 

private static ServerCommandListener listener = new ServerCommandAdapter();

  

  Application.setDefaultName("My Custom Application 1.0");

NetMonitor.addServerCommandListener(listener);

 myServer = new Server("host", port);

 myServer.logon("user", "password");

//... open projects, views, folders, check out files, edit change requests, close views, etc...

myServer.disconnect();

NetMonitor.removeServerCommandListener(listener);

One can as easily log the commands to a file, and use that to analyze the command patterns.

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Version history
Revision #:
1 of 1
Last update:
‎2014-06-16 18:29
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.