From version 7.1 of the Caplin Platform, DataSource timestamps are recorded to a resolution of one microsecond or finer.
This change aligns the Caplin Platform with the financial industry's use of high-resolution timestamps to satisfy regulatory requirements for best execution, such as the revision to the Markets in Financial Instruments Directive due to come into effect on 3 January 2018 (MiFID II).
- Breaking changes in Caplin Platform 7.1
- Timestamp accuracy in Caplin Platform 7.1
- Timestamp resolution in Caplin Platform 7.1
Caplin Platform supports high-resolution timestamps from version 7.1.
High-resolution timestamps are supported by the following operating systems:
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 7
- Windows 7
- Windows 10
- Apple macOS 10.12 (Sierra) and higher
To measure latency with high-resolution timestamps, all components in the latency chain must be 7.1 or higher. Measuring latency across different versions of Caplin Platform components is not supported.
The following breaking changes relating to timestamps were introduced with Caplin Platform 7.1.
New method and function signatures
The following DataSource for Java methods now take a java.time.Instant object as a parameter instead of a long:
- RecordMessage.setInitialLatencyChainTime(java.time.Instant instant)
- RecordMessage.addLatencyChainPoint(String pointName, java.time.Instant instant)
The following DataSource for C (DSDK) functions now take a timespec struct instead of an int64_t:
- void ds_add_latency_chain(ds_data_t* dsdata, char suffix, struct timespec* tp)
- void ds_add_latency_chain2(ds_data_t* dsdata, char suffix, struct timespec tp, char suffix2, struct timespec* tp2)
New binary format for packet logs
The binary format of packet logs has changed in Caplin Platform 7.1 to accommodate microsecond timestamps. Caplin Platform 7.1 packet logs can only be read by logcat 7.1 and later.
New timestamp format in event logs and logcat output
Timestamps for entries in event logs and in logcat output now have microsecond granularity. The fractional seconds component of each timestamp now extends to six figures rather than three, and this may break log scrapers that expect timestamps to have a fractional component fixed at three figures.
|< 7.1||2015/09/22-14:10:57.112 +0100|
|>= 7.1||2015/09/22-14:10:57.112539 +0100|
The accuracy of timestamps recorded by Caplin Platform can only be as accurate as the timestamps supplied to Caplin Platform by the operating system.
To accurately measure latency in the Caplin Platform, all Caplin Platform servers must be synchronised with the same time source.
For Caplin Platform timestamps to be comparable with backend timestamps, Caplin Platform servers must be synchronised with the same time source as backend servers. Backend servers that are compliant with MiFID II requirements for business clock accuracy will be synchronised with a time source that is directly traceable to Coordinated Universal Time (UTC). For an introduction to high-resolution clock synchronisation in the context of MiFID II, see Time Traceability for the Financial Sector, by the UK's National Physical Laboratory.
Timestamp resolution has been increased to microsecond granularity or finer.
DataSource for Java 7.1
The table below documents timestamp granularity in DataSource for Java (DS4J) 7.1
|Event log||Millisecond (see note below)|
The DS4J event log is written using the java.util.logging package, which supports microsecond timestamps from Java 9.
DataSource for Java uses Caplin's open-source Nanotime JNI extension for Java 8 to provide high-resolution timestamps. For more information, see the Nanotime repository on Caplin's GitHub site.
DataSource for C (DSDK) 7.1
The table below documents timestamp granularity in DataSource for C 7.1 and all applications based on DataSource for C 7.1 (Liberator 7.1 and Transformer 7.1).
See DataSource for C (DSDK) 7.1 above.
For information on the precision of Liberator's optional timestamp field, see the documentation for the global timestamp-field configuration item.