Measuring order handling performance in the risk firewall
To help you measure performance, the risk firewall can add timestamps to order events. If added, the timestamps are in the “__timestamps” dictionary, which is a field in the extra parameters dictionary of each order event:
com.apama.oms.NewOrder com.apama.oms.AmendOrder com.apama.oms.CancelOrder com.apama.oms.OrderUpdate An inbound timestamp indicates when the order is placed against the risk firewall and an outbound timestamp indicates when the order is about to go to the order receiver callbacks. Each timestamp is based on the current UTC time.
Adding timestamps adds latency to order handling in the risk firewall. Consequently, the default behavior is that the risk firewall does not add timestamps. If you want the risk firewall to add timestamps, change the setting of one or more of the following risk firewall configuration parameters from false to true.
CONFIG_LOG_INBOUND_LATENCY_TIMESTAMPS indicates whether timestamps are added for inbound new orders and inbound order updates.
CONFIG_LOG_OUTBOUND_LATENCY_TIMESTAMPS indicates whether timestamps are added for outbound new orders and outbound order updates.
CONFIG_LOG_AMEND_CANCEL_LATENCY_TIMESTAMPS indicates whether timestamps are added for amend orders and cancel orders, both inbound and outbound.
For example, if you enable timestamp identifiers for inbound and outbound new orders and update orders, you can measure performance by determining the time that the order spent in the risk firewall:
OutboundTimestamp – InboundTimestamp = TimeOrderSpentInRiskFirewall
When the risk firewall adds timestamps, the addition includes an identifier for each timestamp. The timestamp identifier is the key in the “__timestamps” dictionary contained in the extra parameters dictionary. A timestamp identifier indicates the order type and whether the order was inbound or outbound. To determine the timestamp identifier for an event, the risk firewall uses the value of the CONFIG_LATENCY_TIMESTAMPID_BASE configuration parameter (the default is 7000) with the offsets defined by the following constants:
CONFIG_INBOUND_NEWORDER_TIMESTAMPID_OFFSET is
0 CONFIG_INBOUND_AMENDORDER_TIMESTAMPID_OFFSET is
2 CONFIG_INBOUND_CANCELORDER_TIMESTAMPID_OFFSET is
4 CONFIG_INBOUND_ORDERUPDATE_TIMESTAMPID_OFFSET is
6 CONFIG_OUTBOUND_NEWORDER_TIMESTAMPID_OFFSET is
1 CONFIG_OUTBOUND_AMENDORDER_TIMESTAMPID_OFFSET is
3 CONFIG_OUTBOUND_CANCELORDER_TIMESTAMPID_OFFSET is
5 CONFIG_OUTBOUND_ORDERUPDATE_TIMESTAMPID_OFFSET is
7 For example, the timestamp identifier you would use for when a new order entered the risk firewall would be:
(CONFIG_LATENCY_TIMESTAMPID_BASE+CONFIG_INBOUND_NEWORDER_TIMESTAMP)