forked from antoinewaugh/cme-sbe-latency
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.mon
39 lines (30 loc) · 1.08 KB
/
init.mon
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.apama.marketdata;
using com.softwareag.connectivity.ConnectivityPlugins;
event Depth {
string symbol;
sequence<float> bid_prices;
sequence<integer> bid_volumes;
sequence<float> ask_prices;
sequence<integer> ask_volumes;
sequence<integer> timestamps;
}
monitor init {
import "TimeFormatPlugin" as timeMgr;
action onload() {
log "Loaded init.mon";
monitor.subscribe("cme_sbe_outbound");
on all Depth() as d {
integer rec_ts := d.timestamps[0];
integer dec_ts := d.timestamps[1];
integer presend_ts := d.timestamps[2];
integer send_ts := d.timestamps[3];
integer corr_ts := (timeMgr.getMicroTime() * 1000000000.0).round();
log "Received -> Decoded " + (dec_ts - rec_ts).toString();
log "Decoded -> Presend " + (presend_ts - dec_ts).toString();
log "Presend-> Send " + (send_ts - presend_ts).toString();
log "Send-> Corr " + (corr_ts - send_ts).toString();
//log d.toString();
}
ConnectivityPlugins.onApplicationInitialized();
}
}