Try TT Now

All Gateways

Logging Heartbeats

Overview

If Guardian and Guard Server disconnect frequently for unknown reasons, you can have either of these TT applications generate a log file called HB.log to determine if the problem is due to missed heartbeats. HB.log records each heartbeat sent by the application. As recorded in HB.log, each heartbeat consists of several lines.

Guardian Heartbeats

Each line represents a TT Gateway connection for one of TT's application APIs. By default, each TT application has three APIs: Price, Fill, and Order. However, customers can license only one or two of these APIs instead of all three.

Thus, for example:

  • If your TT client application connects to one TT Gateway, and you use only the Fill and Order APIs, each heartbeat consists of only two lines (one for each API).
  • If your TT client application connects to one TT Gateway, and you use TT's software as distributed (i.e., you use all three client APIs), each heartbeat consists of three lines.
  • If your TT client application connects to two TT Gateways, and you use all three client APIs, each heartbeat consists of six lines.

Guard Server Heartbeats

Each TT Gateway API has its own line and the Guard Server also has a line. By default, the TT Gateway has three APIs: Price, Fill, and Order. However, customers can license only one or two of these APIs instead of all three.

Thus, for example:

  • If you license all of your TT Gateway APIs, each heartbeat consists of four lines: one line for each of the APIs, and a fourth line for the Guard Server.
  • If you license only the Price Server API for a price feed, each heartbeat consists of two lines: one line for the Price API and one line for the Guard Server.

Heartbeat Contents

The HB.log file records heartbeats using the following syntax:

Example HB.log File

HB: HH.MM.SS.mil APPID XchangeID

  • HH: Hour in military time at which Guardian received the heartbeat.
  • MM: Two-digit minute at which Guardian received the heartbeat.
  • SS: Two-digit second at which Guardian received the heartbeat.
  • mil: Three-digit millisecond at which Guardian received the heartbeat.
  • APPID: Application ID. For a list of APPIDs, refer to Application ID Table.
    • For Guardian heartbeats, this value depends upon the TT application in which the APIs run. For example, if the Price, Fill, and Order APIs run inside of X_TRADER®, the APPID will be that of X_TRADER®.
    • For Guard Server heartbeats, this depends upon the server API that the line represents.
  • XchangeID: Exchange ID. For a list of the exchange IDs used by TT Gateways, refer to the Exchange Names.
    • For Guardian heartbeats, XchangeID matches the TT Gateway to which the API connects.
    • For Guard Server heartbeats, XchangeID matches the exchange ID of the TT Gateway on which the API runs.

Turning on Heartbeat Logging

To turn on heartbeat logging, in aconfig_local.xml, you must set the parameter HB-Debug to true.

To log heartbeats:

  1. On the Desktop, double click AConfig Utility.

    The AConfig Utility window appears.

  2. Navigate to AConfigCoreGuardappDebug, where app is either Guardian or GuardServer.
  3. Click HB-Debug.
  4. Click the Value cell.

    You may need to click the cell a second time before being able to edit its values.

  5. Type: true
  6. Click Apply.

    The AConfig Utility writes all changes to aconfig_local.xml.

  7. On the File menu, click Exit.

    Heartbeat logging is now on. However, due to the manner in which Guardian and Guard Server send heartbeats, a log file is generated only when another TT application is running (i.e., X_TRADER® or a TT Gateway component such as the Price or Order Server).

Troubleshooting

After turning on Heartbeat logging, if you notice that heartbeats are not occurring every seven seconds, then you have one of two problems:

  • An API (client or server) has shutdown
  • A client (e.g., X_TRADER®) or server program (e.g., Fill Server) is deadlocked or hung

In the case of an API shutdown, you must stop and restart the TT application. If a particular program is deadlocked, or if network issues are causing missed heartbeats, you can simulate heartbeats to avoid frequent disconnections. Refer to the following section called Simulated Heartbeats.