onixs MD updated to 4.3

This commit is contained in:
Eric Harding committed 2017-10-04 17:27:01 -04:00
1 parent c3150f3a2a
commit e413a0d02f
6 files changed
+52 -42

No files matched your search

+30 -2
View File
@@ -36,8 +36,36 @@
"type": "cppdbg",
"request": "launch",
"program": "/home/eharding/spark/sparkd",
"miDebuggerServerAddress": "localhost:8002",
"args": ["md", "dump"],
"args": [],
"stopAtEntry": false,
"cwd": "/home/eharding/spark/",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"preLaunchTask": "",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "enable pretty-printer",
"ignoreFailures": true
}
],
"pipeTransport": {
"pipeCwd": "${workspaceRoot}",
"pipeProgram": "c:\\program files\\git\\usr\\bin\\ssh.exe",
"pipeArgs": ["eharding@eh-3"],
"debuggerPath": "/usr/bin/gdb"
},
"sourceFileMap": {
"/bts/": "d:\\blue\\spark"
}
},
{
"name": "edge-asp051",
"type": "cppdbg",
"request": "launch",
"program": "/home/ebts/spark/sparkd",
"args": [],
"stopAtEntry": false,
"cwd": "/home/eharding/spark/",
"environment": [],
+3 -18
View File
@@ -8,33 +8,18 @@ PublisherNamespace {
}
}
# MarketDataConfig {
# value {
# use_replay = true
# }
# }
CMEOptions {
rule: "System.build_type == 'debug'"
value {
feed_engine {
name: "default"
udp_socket_buffer_size: 425984
# udp_socket_buffer_size: 425984
channels_per_thread: 1
}
channel {
id: "*"
feed_engine: "default"
use_tcp_replay: false
}
}
}
CMEOptions {
value {
channel {
id: "*"
feed_engine: "default"
use_tcp_replay: false
onixs_log_mode: Regular
}
}
}
-9
View File
@@ -50,17 +50,10 @@ message PublisherNamespace {
message CMEOptions
{
enum OnixSLogMode {
// Disabled = 0;
Important = 10;
Regular = 50;
Debug = 100;
}
// enum OnixSLogAdvanced {
// LogNothing = 0;
// LogFixMessages = 1;
// LogFullBooks = 2;
// LogEverything = 3;
// }
message FeedEngineSettings {
optional string name = 1;
// If num_threads is set it will use that - otherwise it will use channels_per_thread and the number of threads configured for this channel to determine the number of threads
@@ -78,11 +71,9 @@ message CMEOptions
optional string feed_engine = 3 [default = "default"];
// optional uint32 udp_socket_buffer_size = 10 [default = 33554432]; //32mb
optional uint32 max_gap_recovery_cache_size = 11 [default = 6];
optional uint32 lost_packet_wait_timeout_ms = 12 [default = 10];
optional OnixSLogMode onixs_log_mode = 13 [default = Important];
// optional OnixSLogAdvanced onixs_log_advanced = 14 [default = LogNothing];
optional bool prefer_backup_feeds = 15 [default = false];
optional bool use_tcp_replay = 20 [default = true];
@@ -115,28 +115,30 @@ void MDP3Listener::onError(onixs::Handler&, const onixs::ErrorArgs& error) {
void MDP3Listener::onWarning(onixs::Handler&, const onixs::WarningArgs& warning) {
LOG(MarketData,Warn, "OnixS Warn: {} - {}", warning.description(), warning.source());
}
void MDP3Listener::onInstrumentRecovery(onixs::Handler&) {
LOG(MarketData,Info, "Beginning security definition recovery");
void MDP3Listener::onInstrumentRecovery(onixs::Handler& h) {
LOG(MarketData,Info, "Beginning security definition recovery for channel {}", h.settings().channel());
}
void MDP3Listener::onEndOfInstrumentRecovery(onixs::Handler&, const onixs::RecoveryCompletionArgs& args) {
LOG(MarketData,Info, "Security definition recovery complete. {}", args.details());
void MDP3Listener::onEndOfInstrumentRecovery(onixs::Handler& h, const onixs::RecoveryCompletionArgs&) {
LOG(MarketData,Info, "Finished Security definition recovery for channel {}", h.settings().channel());
}
//
// Gap Recovery
void MDP3Listener::onMarketRecovery(onixs::Handler&) {
void MDP3Listener::onMarketRecovery(onixs::Handler& h) {
update_all_status(COCONUTSECURITYSTATUS_PACKET_LOSS);
LOG(MarketData,Info, "Beginning market recovery for channel {}", h.settings().channel());
}
void MDP3Listener::onEndOfMarketRecovery(onixs::Handler&, const onixs::RecoveryCompletionArgs&) {
void MDP3Listener::onEndOfMarketRecovery(onixs::Handler& h, const onixs::RecoveryCompletionArgs&) {
update_all_status(COCONUTSECURITYSTATUS_OK);
LOG(MarketData,Info, "Finished market recovery for channel {}", h.settings().channel());
}
void MDP3Listener::onTcpRecovery(onixs::Handler&) {
void MDP3Listener::onTcpRecovery(onixs::Handler& h) {
update_all_status(COCONUTSECURITYSTATUS_PACKET_LOSS);
LOG(MarketData,Info, "Beginning TCP recovery");
LOG(MarketData,Info, "Beginning tcp recovery for channel {}", h.settings().channel());
}
void MDP3Listener::onEndOfTcpRecovery(onixs::Handler&, const onixs::RecoveryCompletionArgs& args) {
void MDP3Listener::onEndOfTcpRecovery(onixs::Handler& h, const onixs::RecoveryCompletionArgs&) {
update_all_status(COCONUTSECURITYSTATUS_OK);
LOG(MarketData,Info, "TCP recovery completed. {}", args.details());
LOG(MarketData,Info, "Finished tcp recovery for channel {}", h.settings().channel());
}
//
@@ -172,6 +174,7 @@ datetime::Date date_of_maturity(const Definition& def) {
if (def.maturityMonthYear(exp)) {
uint8_t day, month;
if (exp.day(day)) result.day = day;
else result.day = 1;
if (exp.month(month)) result.month = month;
result.year = exp.year();
}
@@ -195,13 +198,14 @@ void set_security_common(const Definition& def, FixedSecurity& fsec) {
void MDP3Listener::onDefinition(onixs::Handler&, const onixs::Security& osec, const onixs::InstrumentDefinitionFutureArgs& def) {
const auto& sec = def.message();
auto exchange_id = sec.securityId();
LOG(MarketData, Info, "onDefinition future {}", exchange_id);
if (filter_security(exchange_id, sec) != ADD) return;
bts_assert(exchange_id == osec.id());
FixedFutureSecurity fsec;
set_security_common(sec, fsec);
fsec.price_break = 0;
fsec.low_tick = fsec.high_tick = double_of_price(sec.minPriceIncrement());
fsec.low_tick = fsec.high_tick = double_of_price(sec.minPriceIncrement()) * pow10(fsec.display_factor);
auto expiration = date_of_maturity(sec);
fsec.expiration_year = expiration.year;
fsec.expiration_month = expiration.month;
@@ -215,6 +219,7 @@ void MDP3Listener::onDefinition(onixs::Handler&, const onixs::Security& osec, co
void MDP3Listener::onDefinition(onixs::Handler&, const onixs::Security&, const onixs::InstrumentDefinitionOptionArgs& def) {
const auto& sec = def.message();
auto exchange_id = sec.securityId();
LOG(MarketData, Info, "onDefinition option {}", exchange_id);
if (filter_security(exchange_id, sec) != ADD) return;
FixedOptionSecurity fsec;
@@ -249,6 +254,7 @@ void MDP3Listener::onDefinition(onixs::Handler&, const onixs::Security&, const o
void MDP3Listener::onDefinition(onixs::Handler&, const onixs::Security&, const onixs::InstrumentDefinitionSpreadArgs& spread_args) {
const auto& sec = spread_args.message();
auto exchange_id = sec.securityId();
LOG(MarketData, Info, "onDefinition spread {}", exchange_id);
if (filter_security(exchange_id, sec) != ADD) return;
// Filter out any already expired spreads
@@ -291,6 +297,7 @@ inline datetime::LLDateTime ll_of_timestamp(const onixs::Timestamp& ts) {
//
// Book
void MDP3Listener::onBookUpdate(onixs::Handler&, const onixs::Security& sec, const onixs::ConsolidatedBook& book) {
LOG(MarketData, Info, "Book update {}", sec.id());
auto data = _index.get_security(sec.id());
if (data == nullptr) return;
bts_assert(data->id == (uint32_t)sec.id());
@@ -90,7 +90,7 @@ private:
onixs::SecurityTradingStatus::Enum trading_status;
if(sec.securityTradingStatus(trading_status) &&
trading_status == onixs::SecurityTradingStatus::NotAvailableForTrading) return SKIP;
return _symbol_filter.count(sec.asset()) == 0 ? ADD : SKIP;
return _symbol_filter.count(sec.asset()) > 0 ? ADD : SKIP;
}
void flush_books();
void update_all_status(co2::CoconutSecurityStatus status);
@@ -333,7 +333,6 @@ unique_ptr<MDP3Listener> MDP3Main::prepare_listener(onixs::Handler& handler, con
handler.registerMarketDataListener(*listener);
handler.registerSecurityListener(*listener);
return listener;
}