Compare commits

...
27 Commits
Author SHA1 Message Date
John Colvin 109fee099f Merged in SPARK-2082 (pull request #181)
SPARK-2082 mview - canceled orders appear to be working

Approved-by: Eric Harding <eric.harding@bluetradesys.com>
Approved-by: Jake Norbut <jake.norbut@bluetradesys.com>
2019-03-01 18:01:31 +00:00
John Colvin 747b44c48d fix strange line ending change in last commit to _index.md 2019-03-01 11:59:01 -06:00
John Colvin 4b091a1259 SPARK-2082 release note 2019-03-01 11:50:56 -06:00
John Colvin 7c0e310f6a SPARK-2082 mview - canceled orders appear to be working 2019-03-01 10:13:49 -06:00
Pete Fisher f7309c389e _index.md edited online with Bitbucket 2019-02-28 21:53:15 +00:00
Pedro Pinto df1dbd76b5 Merge branch 'fix_cache_warm_logs' 2019-02-28 15:58:51 -05:00
Pedro Pinto deaf8b6ad5 Somehow did not push this in. 2019-02-28 15:58:11 -05:00
Pedro Pinto 5e0edd00f4 Merged in fix_cache_warm_logs (pull request #180)
Avoided logging anything when warming up order manager cache.

Approved-by: Taha Afzal <taha.afzal@bluetradesys.com>
2019-02-28 19:20:06 +00:00
Pedro Pinto f25a667ff0 Fixed transition log msg when calling warm cache. 2019-02-28 14:16:38 -05:00
Pedro Pinto 4f3eaa8b9c Updated release notes. 2019-02-28 13:43:41 -05:00
Pedro Pinto 5098767363 Avoided logging anything when warming up order manager cache. 2019-02-28 13:32:43 -05:00
John Colvin 4d52de3f09 Merged in SPARK-2076 (pull request #178)
SPARK-2076 Sounds crash (Dan 1.5)

Approved-by: Eric Harding <eric.harding@bluetradesys.com>
2019-02-27 20:48:54 +00:00
John Colvin 9864d18a60 SPARK-2076 [pr edit] log error instead of throwing an exception (when unable to link predicate). 2019-02-27 14:37:53 -06:00
Pedro Pinto 2aaa3258a0 Updated release notes. 2019-02-27 14:42:38 -05:00
Pedro Pinto 6e98e11c9e Merge branch 'master' of bitbucket.org:bluetradesys/spark 2019-02-27 14:40:16 -05:00
Pedro Pinto fa4d50b643 Removed unused variable. 2019-02-27 14:40:00 -05:00
John Colvin 1590c6d6f6 SPARK-2076 Sounds crash (Dan 1.5) 2019-02-27 13:37:50 -06:00
Pedro Pinto 224d0689b0 Added logging to AlgoDefinitionServiceServer, used ref over copy. 2019-02-27 14:37:45 -05:00
Eric Harding c69fa3a410 advance linux docker subrepo pointer 2019-02-27 11:21:56 -05:00
Eric Harding 14307f9fd8 Merged in LoggerUltimatum (pull request #176)
Give LoggerHub at most 2 seconds to cleanly shut down

Approved-by: Pedro Pinto <pedro.pinto+atlassian@bluetradesys.com>
2019-02-26 21:32:18 +00:00
Eric Harding 819a984ccd Give LoggerHub at most 2 seconds to cleanly shut down 2019-02-26 15:55:34 -05:00
Eric Harding d76b04b752 Release Note: 'missing securities in the Fills and P&L windows.' 2019-02-26 13:21:23 -05:00
Eric Harding 4904763811 Update CMakeDeps master 2019-02-26 13:21:03 -05:00
Eric Harding 073294adac Enable -configserver for sparkcmd servicetail tool 2019-02-26 12:44:07 -05:00
Eric Harding 753bb1b493 Merged in Fills_join_fix (pull request #175)
Fix shell on_fills security join

Approved-by: Jake Norbut <jake.norbut@bluetradesys.com>
2019-02-26 17:14:28 +00:00
Eric Harding 8891e89c70 Fix shell on_fills security join 2019-02-26 11:56:00 -05:00
Jake Norbut d3305b7990 fixing typo in release notes 2019-02-25 10:42:50 -06:00
12 changed files with 97 additions and 36 deletions

No files matched your search

+15 -1
View File
@@ -4,6 +4,20 @@ weight = 3
sort_by = "weight"
insert_anchor_links = "right"
+++
## 1.5.5
- Fixed Market View 'stale working orders' bug
## 1.5.4
- Avoided logging when warming up cache
## 1.5.3
- Fixed sounds startup issue
## 1.5.2
- Added better logging to AlgoDefinitionService
## 1.5.1
- Fixed missing securities in the Fills and P&L windows.
## 1.5.0
### User Visible Changes
@@ -21,7 +35,7 @@ insert_anchor_links = "right"
- The escape key now closes the floating order book
#### Bug Fixes
- Fixed the "Since Open" time filter to use the exchange open time rather than 8:30 AM
- Fixed a bug in the order book where sometimes parent orders whould not update their last message column.
- Fixed a bug in the order book where sometimes parent orders would not update their last message column.
#### Algos
- Added OCO Algo
@@ -25,20 +25,28 @@ namespace bts.shell {
}
static class NotificationServiceExtensions {
/// TODO: remove this extension and force callers to use the appropriate 'link' method in <see cref="INotificationService"/> (it is smelly, and is NOT ACTUALLY STRONGLY TYPED)
public static IDisposable link<T>(this INotificationService notification_service, IPredicate<T> predicate, SoundNotification sound) {
if (predicate is IPredicate<OrderTuple> orp)
return notification_service.link_to_order(orp, sound);
if (predicate is IPredicate<OrderSecurity> osp) {
// Note: watch out for implicit types as generic type arguments (although OrderSecurity can be implicitly cast to OrderTuple, IPredicate<OrderSecurity> CANNOT be implicitly cast to IPredicate<OrderTuple>)
return notification_service.link_to_order(PredicateBuilder.create<OrderTuple>(ot => osp.trigger(new OrderSecurity(ot.Item1, ot.Item2))), sound);
}
if (predicate is IPredicate<Activity> ap)
return notification_service.link_to_activity(ap, sound);
throw new ArgumentException(nameof(predicate));
Log.Ui.error($"Unable to activate sound-trigger (unrecognized predicate type '{typeof(T)}').");
return Disposable.empty;
}
/// TODO: remove this extension and force callers to use the appropriate 'link' method in <see cref="INotificationService"/> (it is smelly, and is NOT ACTUALLY STRONGLY TYPED)
public static IDisposable link<T>(this INotificationService notification_service, INotificationPredicate<T> toast_notification_predicate) {
if (toast_notification_predicate is INotificationPredicate<OrderTuple> orp)
return notification_service.link_to_order(orp);
if (toast_notification_predicate is INotificationPredicate<Activity> ap)
return notification_service.link_to_activity(ap);
throw new ArgumentException(nameof(toast_notification_predicate));
Log.Ui.error($"Unable to activate toast-notification-trigger (unrecognized predicate type '{typeof(T)}').");
return Disposable.empty;
}
}
+3 -3
View File
@@ -13,11 +13,11 @@ namespace mbts.spark {
public readonly AlgoData? algo;
public readonly AlgoDefinitionMetadata? algo_meta;
public FillTuple(FillImmutable fill, OrderSecurityAlgoMeta? order_tuple) {
this.fill = fill;
public FillTuple((SecurityImmutable? sec, FillImmutable val) fill, OrderSecurityAlgoMeta? order_tuple) {
this.fill = fill.val;
this.security = fill.sec;
if (order_tuple is OrderSecurityAlgoMeta osam) {
order = osam.order;
security = osam.security;
algo = osam.algo;
algo_meta = osam.meta;
}
+4 -3
View File
@@ -91,12 +91,13 @@ namespace mbts.spark {
_service.subscribei_fills()
.Naggle(interval, scheduler)
.PermissionFilter(admin_model.on_admin_data)
.join(sstore, f => f.SecurityKey)
.Table().Cache();
var fill_order_tuples_join = on_fills.LeftJoin(
on_order_tuples,
f => f.FillKey,
f => f.val.FillKey,
o => o.order.Key,
f => f.OrderKey,
f => f.val.OrderKey,
(f, fk, o, ok) => new FillTuple(f, o),
(f, fk, ok) => new FillTuple(f, null),
f => f.fill.FillKey);
@@ -284,7 +285,7 @@ namespace mbts.spark {
// DO NOT REMOVE (END)
public static IObservable<ITableUpdateTransform<OrderRecordImmutable, uint>> on_security_root_orders(this OrdersModel orders_model, uint security_key) =>
orders_model.on_security_orders(security_key).Scan(new RootOrderData(), (rod, table) => {
orders_model.on_security_orders(security_key).AddRemoveOnly().Scan(new RootOrderData(), (rod, table) => {
// ** using HashSet/List pairs, rather than a Dictionary, because TableUpdateTransform calls for IReadOnlyLists, while Dictionary.Values only implements IReadOnlyCollection.
// (this way, we avoid copying both added/removed Dictionary.Values to new Lists at the end, see comment at bottom of method if this is unclear) **
var added_root_keys = new HashSet<uint>();
+1
View File
@@ -19,6 +19,7 @@ namespace bts {
// The following are not implemented. If you need them get to work.
HasOption("path", "Path inside the row to use for display. Ex: 'Id' or 'Name' ", ignore);
HasOption("all", "Invlude 'all' rows on every print", _ => _all = true);
HasAdditionalArguments(null, " [nothing]");
}
public override int Run(string[] remainingArguments) {
var arg = this.get_argument("method");
+1 -1
View File
@@ -1 +1 @@
set(sources api/apicore.proto;api/apigateway.proto;api/apioptions.proto;api/core/ApiClientInterop.cpp;api/core/ApiServerInterop.cpp;api/public/ApiServer.cpp;api/public/ClientChannel.cpp;api/public/QuickbusClientChannel.cpp;api/public/ServerChannel.cpp;api/public/ServiceContext.cpp;api/service_helpers/AdminServiceUtils.cpp;api/services/AdminService.proto;api/services/ApiUnitTestService.proto;api/services/AuthService.proto;api/services/ErrorReportService.proto;api/services/HelloService.proto;api/services/MarketDataAuxiliaryService.proto;api/services/MarketDataRelay.proto;api/services/OrderService.proto;api/services/OutOfProcessURLListener.proto;api/services/PersistenceService.proto;api/services/PositionService.proto;api/services/ShellDiagnosticService.proto;api/services/ShellLatencyService.proto;api/services/SyntheticSecurityService.proto;api/test/ApiTests.cpp;api/test/HelloServiceServer.cpp;config/ConfigCheck.cpp;config/ConfigDownloader.cpp;config/ConfigErrorCollector.cpp;config/ConfigLog.cpp;config/ConfigPropertyEvaluator.cpp;config/ConfigValueQueue.cpp;config/ConfigurationException.cpp;config/ConfigurationState.cpp;config/PreprocessInputStream.cpp;config/config.cpp;config/defaults/MarketData.conf;config/defaults/Ports.conf;config/defaults/Symbols.conf;config/defaults/cme_reference_data.conf;config/defaults/edge.conf;config/defaults/jetfix.conf;config/defaults/logging.conf;config/defaults/orderman_cfg.conf;config/defaults/orders_fills_cleanup.conf;config/defaults/spreader.conf;config/defaults/testkeys.conf;config/defaults/threads.conf;config/defaults/toggles.conf;config/extensions/extensions.proto;config/invalid/invalid.proto;config/protos/ExchangeSimCfg.proto;config/protos/MarketData.proto;config/protos/Ports.proto;config/protos/Symbols.proto;config/protos/UI.proto;config/protos/cme_reference_data.proto;config/protos/jetfix.proto;config/protos/logging.proto;config/protos/mercury_cfg.proto;config/protos/orderman_cfg.proto;config/protos/orders_fills_cleanup.proto;config/protos/perflog_cfg.proto;config/protos/quickbus_cfg.proto;config/protos/spreader.proto;config/protos/system.proto;config/protos/testkeys.proto;config/protos/threads.proto;config/protos/toggles.proto;config/tests/HTTPServer.cpp;config/tests/config_ref_tests.cpp;config/tests/config_tests.cpp;config/text_format/text_format.cpp;domain_model/Security.cpp;domain_model/Security.proto;domain_model/SecurityTests.cpp;domain_model/tests/domain_tests.cpp;expression/BooleanGrammar.cpp;expression/ExpressionEvaluator.cpp;expression/ParserExceptions.cpp;expression/Value.cpp;expression/tests/expression_parser_tests.cpp;logging/LoggerHub.cpp;logging/Sink.cpp;logging/logging.cpp;logging/tests/logging_tests.cpp;md/Diag/MDPeriodicDumper.cpp;md/Diag/ShmDumper.cpp;md/MDClient.cpp;md/MDConsumer.cpp;md/MDConsumerHandle.cpp;md/MDConsumerInterop.cpp;md/MDProducer.cpp;md/MDProducerHandle.cpp;md/MemorySegmentUtils.cpp;md/PlatformLoader.cpp;md/PriceSize.cpp;md/SecurityCache.cpp;md/SecurityDB.cpp;md/SecurityIDRecorder.cpp;md/SecurityOracle.cpp;md/SettlementRecorder.cpp;md/Shm/FixedSecurity.cpp;md/SyntheticSecurityService.cpp;md/cme/MDP3Utils.cpp;md/common.cpp;md/protos/co2.proto;md/relay/QueryServer.cpp;md/relay/RelayClient.cpp;md/relay/RelayRecorder.cpp;md/test/Co2ManagedTestHelper.cpp;md/test/Co2TestInstrument.cpp;md/test/md2_tests.cpp;md/test/synthetic_book_merge_tests.cpp;os/os.cpp;os/tests/os_tests.cpp;quickbus/core/LocalNode.cpp;quickbus/core/Quickbus.cpp;quickbus/core/SubscriptionID.cpp;quickbus/core/TableID.cpp;quickbus/message_model/Update.cpp;quickbus/message_model/merge_updates.cpp;quickbus/network/QBConnection.cpp;quickbus/network/QBConnectionManager.cpp;quickbus/network/endpoint_description.cpp;quickbus/network/quickbus_msgs.proto;quickbus/pubsub/TablePublisher.cpp;quickbus/pubsub/TableSubscriber.cpp;quickbus/pubsub/tests/qb_pubsub_tests.cpp;quickbus/routing/INode.cpp;quickbus/routing/NodeID.cpp;quickbus/routing/Router.cpp;quickbus/rpc/RPCClient.cpp;quickbus/rpc/RPCServer.cpp;quickbus/rpc/RPCSessionID.cpp;quickbus/rpc/rpc_utils.cpp;quickbus/rpc/tests/qb_rpc_tests.cpp;quickbus/tests/quickbus_tests.cpp;sparkproto/SparkProtos.proto;testing/catch_test_runner.cpp;utils/AuthToken.cpp;utils/Dispatcher.cpp;utils/GrowableSPSCQueue.cpp;utils/HTTPStream.cpp;utils/PBUtils.cpp;utils/Puid.cpp;utils/SecureLogon.cpp;utils/SharedMemory.cpp;utils/Sqlite_utils.cpp;utils/Uuid.cpp;utils/datetime.cpp;utils/download.cpp;utils/file_utils.cpp;utils/init_spark_lib.cpp;utils/is_unittest_environment.cpp;utils/stats.cpp;utils/tests/AuthTokenTests.cpp;utils/thread_manager.cpp)
set(sources api/apicore.proto;api/apigateway.proto;api/apioptions.proto;api/core/ApiClientInterop.cpp;api/core/ApiServerInterop.cpp;api/public/ApiServer.cpp;api/public/ClientChannel.cpp;api/public/QuickbusClientChannel.cpp;api/public/ServerChannel.cpp;api/public/ServiceContext.cpp;api/service_helpers/AdminServiceUtils.cpp;api/service_helpers/AlgoServiceUtils.cpp;api/services/AdminService.proto;api/services/AlgoDefinitionService.proto;api/services/AlgoService.proto;api/services/ApiUnitTestService.proto;api/services/AuthService.proto;api/services/ErrorReportService.proto;api/services/HelloService.proto;api/services/MarketDataAuxiliaryService.proto;api/services/MarketDataRelay.proto;api/services/OrderService.proto;api/services/OutOfProcessURLListener.proto;api/services/PersistenceService.proto;api/services/PositionService.proto;api/services/ShellDiagnosticService.proto;api/services/ShellLatencyService.proto;api/services/SyntheticSecurityService.proto;api/test/ApiTests.cpp;api/test/HelloServiceServer.cpp;config/ConfigCheck.cpp;config/ConfigDownloader.cpp;config/ConfigErrorCollector.cpp;config/ConfigLog.cpp;config/ConfigPropertyEvaluator.cpp;config/ConfigValueQueue.cpp;config/ConfigurationException.cpp;config/ConfigurationState.cpp;config/PreprocessInputStream.cpp;config/config.cpp;config/defaults/MarketData.conf;config/defaults/Ports.conf;config/defaults/Symbols.conf;config/defaults/cme_reference_data.conf;config/defaults/edge.conf;config/defaults/jetfix.conf;config/defaults/logging.conf;config/defaults/orderman_cfg.conf;config/defaults/orders_fills_cleanup.conf;config/defaults/spreader.conf;config/defaults/testkeys.conf;config/defaults/threads.conf;config/defaults/toggles.conf;config/extensions/extensions.proto;config/invalid/invalid.proto;config/protos/ExchangeSimCfg.proto;config/protos/MarketData.proto;config/protos/Ports.proto;config/protos/Symbols.proto;config/protos/UI.proto;config/protos/cme_reference_data.proto;config/protos/jetfix.proto;config/protos/logging.proto;config/protos/mercury_cfg.proto;config/protos/orderman_cfg.proto;config/protos/orders_fills_cleanup.proto;config/protos/perflog_cfg.proto;config/protos/quickbus_cfg.proto;config/protos/spreader.proto;config/protos/system.proto;config/protos/testkeys.proto;config/protos/threads.proto;config/protos/toggles.proto;config/tests/HTTPServer.cpp;config/tests/config_ref_tests.cpp;config/tests/config_tests.cpp;config/text_format/text_format.cpp;domain_model/Security.cpp;domain_model/Security.proto;domain_model/SecurityTests.cpp;domain_model/tests/domain_tests.cpp;expression/BooleanGrammar.cpp;expression/ExpressionEvaluator.cpp;expression/ParserExceptions.cpp;expression/Value.cpp;expression/tests/expression_parser_tests.cpp;logging/LoggerHub.cpp;logging/Sink.cpp;logging/logging.cpp;logging/tests/logging_tests.cpp;md/Diag/MDPeriodicDumper.cpp;md/Diag/ShmDumper.cpp;md/MDClient.cpp;md/MDConsumer.cpp;md/MDConsumerHandle.cpp;md/MDConsumerInterop.cpp;md/MDProducer.cpp;md/MDProducerHandle.cpp;md/MemorySegmentUtils.cpp;md/PlatformLoader.cpp;md/PriceSize.cpp;md/SecurityCache.cpp;md/SecurityDB.cpp;md/SecurityIDRecorder.cpp;md/SecurityOracle.cpp;md/SettlementRecorder.cpp;md/Shm/FixedSecurity.cpp;md/SyntheticSecurityService.cpp;md/cme/MDP3Utils.cpp;md/common.cpp;md/protos/co2.proto;md/relay/QueryServer.cpp;md/relay/RelayClient.cpp;md/relay/RelayRecorder.cpp;md/test/Co2ManagedTestHelper.cpp;md/test/Co2TestInstrument.cpp;md/test/md2_tests.cpp;md/test/synthetic_book_merge_tests.cpp;os/os.cpp;os/tests/os_tests.cpp;quickbus/core/LocalNode.cpp;quickbus/core/Quickbus.cpp;quickbus/core/SubscriptionID.cpp;quickbus/core/TableID.cpp;quickbus/message_model/Update.cpp;quickbus/message_model/merge_updates.cpp;quickbus/network/QBConnection.cpp;quickbus/network/QBConnectionManager.cpp;quickbus/network/endpoint_description.cpp;quickbus/network/quickbus_msgs.proto;quickbus/pubsub/TablePublisher.cpp;quickbus/pubsub/TableSubscriber.cpp;quickbus/pubsub/tests/qb_pubsub_tests.cpp;quickbus/routing/INode.cpp;quickbus/routing/NodeID.cpp;quickbus/routing/Router.cpp;quickbus/rpc/RPCClient.cpp;quickbus/rpc/RPCServer.cpp;quickbus/rpc/RPCSessionID.cpp;quickbus/rpc/rpc_utils.cpp;quickbus/rpc/tests/qb_rpc_tests.cpp;quickbus/tests/quickbus_tests.cpp;sparkproto/SparkProtos.proto;testing/catch_test_runner.cpp;utils/AuthToken.cpp;utils/Dispatcher.cpp;utils/GrowableSPSCQueue.cpp;utils/HTTPStream.cpp;utils/PBUtils.cpp;utils/Puid.cpp;utils/SecureLogon.cpp;utils/SharedMemory.cpp;utils/Sqlite_utils.cpp;utils/Uuid.cpp;utils/datetime.cpp;utils/download.cpp;utils/file_utils.cpp;utils/init_spark_lib.cpp;utils/is_unittest_environment.cpp;utils/stats.cpp;utils/tests/AuthTokenTests.cpp;utils/thread_manager.cpp)
+2 -1
View File
@@ -110,6 +110,7 @@ void LoggerHub::do_work() {
std::this_thread::sleep_for(10ms);
}
auto start = Timer::now();
for (;;) {
auto all_shutdown = false;
{
@@ -117,7 +118,7 @@ void LoggerHub::do_work() {
consume_log_recs();
all_shutdown = me->loggers.empty();
}
if (all_shutdown)
if (all_shutdown || std::abs(sec_diff(start, Timer::now())) > 2)
return;
else
std::this_thread::yield();
+26 -16
View File
@@ -1,10 +1,10 @@
#include "NativeOrder.h"
#include "lib/api/services/OrderService.pb.h"
#include "lib/domain_model/Security.h"
#include "lib/jetfix/codec/FIXFragment.h"
#include "lib/jetfix/codec/FieldDefinitions.h"
#include "lib/logging/logging.h"
#include "lib/domain_model/Security.h"
#include "lib/orderman/order_factory/IOrderFactory.h"
#include "lib/orderman/order_router/OrderRouter.h"
#include "lib/orderman/orderman_utils/ExecutionReport.h"
@@ -276,7 +276,8 @@ void NativeOrder::on_init_from_exe_report(
NativeOrder::~NativeOrder() {}
bool NativeOrder::_on_activate(Price p, Quantity q,
bool NativeOrder::_on_activate(log::Level reject_level,
log::Level transition_level, Price p, Quantity q,
bts::orderman::OrderServices &services,
trace::CorID const &trace) {
auto scoped_log =
@@ -295,11 +296,12 @@ bool NativeOrder::_on_activate(Price p, Quantity q,
// is our gateway connected?
if (!me->services->is_gateway_connected(*me->session_services)) {
LOG(OrderMan, Warn,
LOG(OrderMan, reject_level,
"Attempt to send order to a disconnected gateway. "
"Dropping order {}",
key().value());
transition(ORDER_STATUS_REJECTED_BY_SPARK, "Exchange gateway is down");
transition(transition_level, ORDER_STATUS_REJECTED_BY_SPARK,
"Exchange gateway is down");
return false;
}
@@ -308,13 +310,13 @@ bool NativeOrder::_on_activate(Price p, Quantity q,
UserID(me->definition.user_id()),
AccountID(me->definition.account_id()));
if (!lqr.ok) {
LOG(OrderMan, Warn,
LOG(OrderMan, reject_level,
"Unauthorized order attempted. User: {} on "
"Account: {}. Msg: {} Order: {}. Dropping order",
me->definition.user(), me->definition.account(), lqr.error_msg,
key().value());
transition(ORDER_STATUS_REJECTED_BY_SPARK,
transition(transition_level, ORDER_STATUS_REJECTED_BY_SPARK,
fmt::format("Unauthorized order: {}", lqr.error_msg));
return false;
}
@@ -325,24 +327,24 @@ bool NativeOrder::_on_activate(Price p, Quantity q,
q);
if (!lqr.ok) {
LOG(OrderMan, Warn,
LOG(OrderMan, reject_level,
"New order would breach limit. User: {} Account: "
"{} Msg: {} Order: {}. Dropping order",
me->definition.user(), me->definition.account(), lqr.error_msg,
key().value());
transition(ORDER_STATUS_REJECTED_BY_SPARK,
transition(transition_level, ORDER_STATUS_REJECTED_BY_SPARK,
fmt::format("Order would breach limit: {}", lqr.error_msg));
return false;
}
// are we under the messaging threshold?
if (!me->services->governor(*me->session_services).can_send()) {
LOG(OrderMan, Warn,
LOG(OrderMan, reject_level,
"New order would cause breach of messaging "
"limits. Dropping order {}",
key().value());
transition(ORDER_STATUS_REJECTED_BY_SPARK,
transition(transition_level, ORDER_STATUS_REJECTED_BY_SPARK,
"Messaging threshold breached");
return false;
}
@@ -391,7 +393,7 @@ void NativeOrder::warm_up_activate(OrderServicesData &data,
bts_assert(!me->services);
me->services = &services;
init_order_services(data, services);
_on_activate(Price(0), Quantity(0), services, trace::CorID{});
_on_activate(NoLog, NoLog, Price(0), Quantity(0), services, trace::CorID{});
me->services->unsubscribe_from_exe_report(*me->session_services,
me->exe_report_sid);
@@ -411,7 +413,7 @@ void NativeOrder::on_activate(Price p, Quantity q,
case ORDER_STATUS_INACTIVE:
// this is a brand new order
if (_on_activate(p, q, services, trace)) {
if (_on_activate(Warn, Info, p, q, services, trace)) {
me->services->queue_fix(*me->session_services,
jetfix::MessageTypes::NewOrderSingle,
me->create_encoding, trace);
@@ -1044,20 +1046,28 @@ bool NativeOrder::has_exchange_order_id() {
return get_native_state(me->state).exchange_order_id().size();
}
void NativeOrder::transition(api::orderman::OrderStatus new_status,
void NativeOrder::transition(log::Level level,
api::orderman::OrderStatus new_status,
std::string const &msg) {
auto const &from = OrderStatus_Name(me->state.status());
auto const &to = OrderStatus_Name(new_status);
LOG(OrderMan, Info, "Transitioning order {} from {} to {}. Msg: {}",
key().value(), from, to, msg);
if (me->state.status() != new_status) {
LOG(OrderMan, level, "Transitioning order {} from {} to {}. Msg: {}",
key().value(), from, to, msg);
}
me->state.set_status(new_status);
me->state.set_last_msg(msg);
}
void NativeOrder::transition(api::orderman::OrderStatus new_status,
std::string const &msg) {
transition(Info, new_status, msg);
}
void NativeOrder::transition(api::orderman::OrderStatus new_status) {
auto const &from = OrderStatus_Name(me->state.status());
auto const &to = OrderStatus_Name(new_status);
if (from != to)
if (me->state.status() != new_status)
LOG(OrderMan, Info, "Transitioning order {} from {} to {}", key().value(),
from, to);
else
+7 -4
View File
@@ -32,14 +32,15 @@ class NativeOrder : public Order {
void on_init_from_exe_report(ExecutionReport const &,
const PreActivationOrderServices &);
protected:
void warm_up_activate(OrderServicesData &,OrderServices&) override;
protected:
void warm_up_activate(OrderServicesData &, OrderServices &) override;
private:
struct PImpl;
std::unique_ptr<PImpl> me;
bool _on_activate(Price, Quantity, bts::orderman::OrderServices &,
bool _on_activate(log::Level reject_level, log::Level transition_level,
Price, Quantity, bts::orderman::OrderServices &,
trace::CorID const &);
void on_exe_report(const NewExecutionReportEvent &);
void on_cancel_reject(const CancelRejectEvent &);
@@ -49,6 +50,8 @@ protected:
void init_fix();
void add_exchange_order_id_to_fix();
void transition(log::Level level, api::orderman::OrderStatus new_state,
std::string const &msg);
void transition(api::orderman::OrderStatus new_state,
std::string const &msg);
void transition(api::orderman::OrderStatus new_state);
@@ -26,9 +26,19 @@ AlgoDefinitionServiceServer::AlgoDefinitionServiceServer(ServiceContext& context
}
AlgoDefinitionServiceServer::~AlgoDefinitionServiceServer() { }
struct Trace {
Trace(std::string const &msg) : msg(msg) {LOG(Gen, Info, "begin {}",msg);}
~Trace() {LOG(Gen, Info, "end {}",msg);}
std::string msg;
};
void AlgoDefinitionServiceServer::save_algo_definition(
const UpdateRequest& request,
const APIResponse<UpdateResponse>& response) {
Trace t(fmt::format("{} {}", __PRETTY_FUNCTION__,
utils::pb::to_string(request)));
UpdateResponse response_data;
response_data.set_success(false);
stringstream error;
@@ -71,6 +81,10 @@ void AlgoDefinitionServiceServer::save_algo_definition(
void AlgoDefinitionServiceServer::remove_algo_definition(
const RemoveRequest& request, const APIResponse<RemoveResponse>& response) {
Trace t(fmt::format("{} {}", __PRETTY_FUNCTION__,
utils::pb::to_string(request)));
RemoveResponse response_data;
response_data.set_success(false);
const Row* row = _find_row(request.key());
@@ -96,9 +110,12 @@ void AlgoDefinitionServiceServer::remove_algo_definition(
#endif
}
response(response_data);
LOG(Gen, Info, "AlgoServiceServer.remove_algo_definition end");
}
const Row* AlgoDefinitionServiceServer::_find_row(const uint32_t key) {
Trace t(fmt::format("{} {}", __PRETTY_FUNCTION__,key));
const auto& table = me->publisher.state_data();
const auto it = table.find(key);
if (it != table.end())
@@ -107,7 +124,9 @@ const Row* AlgoDefinitionServiceServer::_find_row(const uint32_t key) {
}
uint32_t AlgoDefinitionServiceServer::_get_unused_key() {
auto table = me->publisher.state_data();
Trace t(__PRETTY_FUNCTION__);
auto const &table = me->publisher.state_data();
uint32_t unused = 1;
while (table.find(unused) != table.end())
unused++;
@@ -115,6 +134,8 @@ uint32_t AlgoDefinitionServiceServer::_get_unused_key() {
}
RowMetadata AlgoDefinitionServiceServer::_mk_metadata(const uint32_t user_id) {
Trace t(__PRETTY_FUNCTION__);
RowMetadata meta;
meta.set_is_active(true);
meta.set_creator_user_id(user_id);
@@ -122,6 +143,8 @@ RowMetadata AlgoDefinitionServiceServer::_mk_metadata(const uint32_t user_id) {
}
void AlgoDefinitionServiceServer::_publish_all() {
Trace t(__PRETTY_FUNCTION__);
map<string, map<string, string>> all_data = me->store->retrieve_all();
auto table=all_data.find(me->table_name);
if (table!=all_data.end()) {
@@ -138,6 +161,8 @@ void AlgoDefinitionServiceServer::_publish_all() {
}
bool AlgoDefinitionServiceServer::_publish_update(bool insert, const Row& row) {
Trace t(fmt::format("{} {} {}", __PRETTY_FUNCTION__,insert,utils::pb::to_string(row)));
string ser;
if(row.SerializeToString(&ser)) {
if (insert)
@@ -154,4 +179,4 @@ bool AlgoDefinitionServiceServer::_publish_update(bool insert, const Row& row) {
} // namespace algo
} // namespace orderman
} // namespace api
} // namespace bts
} // namespace bts
@@ -338,8 +338,6 @@ unique_ptr<MDP3Listener> MDP3Main::prepare_listener(onixs::Handler& handler, con
producer_channels.push_back(_producer.get_channel(symbol.symbol().c_str(), symbol.type(), symbol.exchange()));
}
const auto& options = channel_settings_for(channel.id);
unique_ptr<MDP3Listener> listener(new MDP3Listener(_index, _producer, /*_settlement_recorder,*/ producer_channels));
for (auto& symbol : channel.symbols) {
listener->add_filter_symbol(symbol.symbol());