spark-186 fix md recorder

This commit is contained in:
Eric Harding committed 2017-09-22 15:05:42 -04:00
1 parent 5fc7d3ff78
commit d5f10d83c6
8 files changed
+61 -10

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Docker Launch",
"type": "cppdbg",
"request": "launch",
"program": "/bts/build/gcc_debug/src/server/sparkd/sparkd",
"miDebuggerServerAddress": "localhost:8002",
"args": [],
"stopAtEntry": false,
"cwd": "/bts/build/gcc_debug/src/server/sparkd/",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "gdb.cmd",
"preLaunchTask": "",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "enable pretty-printer",
"ignoreFailures": true
},
{
"description": "enable remote",
"text": "target remote localhost:8002",
"ignoreFailures": false
}
]
}
]
}
+2 -2
View File
@@ -59,7 +59,7 @@ RelayRecorder::RelayRecorder(const std::string& base_path, const std::string& fi
CoconutReplayHeader header;
header.set_magic(magic);
header.set_version(2);
header.set_version(3);
header.set_timestamp(datetime::ll_now());
header.set_host(config::get<config::System>().config_host());
header.set_naggle_ms(naggle);
@@ -113,7 +113,7 @@ void replay_recording(istream& in, IRelayWriter& writer, int32_t naggle_ms) {
bts_assert(!in.bad());
CoconutReplayHeader header;
size_t count = 0;
if (readbuf(in, &header) && header.magic() == magic && header.version() <= 2) {
if (readbuf(in, &header) && header.magic() == magic && header.version() == 3) {
co2::MDReply message;
while (readbuf(in, &message)) {
writer.write(message, nullptr);
+5 -5
View File
@@ -24,11 +24,11 @@ private:
BTS_NO_COPY(RelayRecorder);
};
BTS_EXPORT void record_everything(std::string path, std::string filename);
BTS_EXPORT void print_recording(const std::string&);
BTS_EXPORT void unprint_recording(const std::string& src, const std::string& dest);
BTS_EXPORT void trace_recording(const std::string& file, security_key key);
BTS_EXPORT void replay_recording(const std::string&, int32_t delay_ms);
void record_everything(std::string path, std::string filename);
void print_recording(const std::string&);
void unprint_recording(const std::string& src, const std::string& dest);
void trace_recording(const std::string& file, security_key key);
void replay_recording(const std::string&, int32_t delay_ms);
}}//namespace
+1 -1
View File
@@ -1 +1 @@
set(sources ;fabric/Actor.cpp;fabric/Domain.cpp;fabric/Executor.cpp;fabric/IActor.cpp;fabric/IDomain.cpp;fabric/TopicDirectory.cpp;fabric/tests/baseline_perf_fabric_test.cpp;fabric/tests/fabric_test.cpp;grid/Node.cpp;jetfix/codec/FIXArray.cpp;jetfix/common/OutFIX.cpp;jetfix/connection/AsyncReader.cpp;jetfix/connection/IConnection.cpp;jetfix/connection/SocketConnection.cpp;jetfix/gateway/CoreGateway.cpp;jetfix/gateway/JetFIXGateway.cpp;jetfix/gateway/Session.cpp;jetfix/store/FIXFileStore.cpp;jetfix/store/session_name.cpp;jetfix/tests/async_reader_tests.cpp;jetfix/tests/decoding_tests.cpp;jetfix/tests/fix_encoding_stream_tests.cpp;jetfix/tests/fix_fragment_tests.cpp;jetfix/tests/jetfix_performance_tests.cpp;jetfix/tests/store_tests.cpp;main.cpp;md/platforms/mdp3_onixs/MDP3Listener.cpp;md/platforms/mdp3_onixs/MDP3Main.cpp;md/platforms/mdp3_onixs/MDP3Utils.cpp;md/platforms/mdp3_onixs/tests/mdp3_tests.cpp;md/run_md.cpp;order_man/IFIXGateway.cpp;order_man/IOrderObserver.cpp;order_man/OldOrderMan.cpp;order_man/OrderMan.cpp;order_man/OrderState.cpp;order_man/OrderStore.cpp;order_man/WorkingOrder.cpp;order_man/components/MDSource.cpp;order_man/components/SecuritySource.cpp;order_man/events/TimeChange.cpp;order_man/fix_order_codec.cpp;order_man/order_man_utils.cpp;persistence/IStore.cpp;persistence/PersistenceServiceServer.cpp;persistence/SqliteStore.cpp;persistence/tests/PersistenceServiceTests.cpp;risk_limits/IRiskLimitObserver.cpp;risk_limits/RiskLimitManager.cpp;risk_limits/RiskLimiter.cpp;risk_limits/SharedRiskLimiter.cpp;risk_limits/tests/RiskLimitsTests.cpp;setup/BootstrapActor.cpp;setup/ServiceHostActor.cpp;spreader/QuoteLegPriceQuantityState.cpp;spreader/SimpleSpreader.cpp;spreader/SingleLegQuoter.cpp;spreader/SpreaderBase.cpp;testing/catch_test_runner.cpp;user/UserServiceServer.cpp)
set(sources fabric/Actor.cpp;fabric/Domain.cpp;fabric/Executor.cpp;fabric/IActor.cpp;fabric/IDomain.cpp;fabric/TopicDirectory.cpp;fabric/tests/baseline_perf_fabric_test.cpp;fabric/tests/fabric_test.cpp;grid/Node.cpp;jetfix/codec/FIXArray.cpp;jetfix/common/OutFIX.cpp;jetfix/connection/AsyncReader.cpp;jetfix/connection/IConnection.cpp;jetfix/connection/SocketConnection.cpp;jetfix/gateway/CoreGateway.cpp;jetfix/gateway/JetFIXGateway.cpp;jetfix/gateway/Session.cpp;jetfix/store/FIXFileStore.cpp;jetfix/store/session_name.cpp;jetfix/tests/async_reader_tests.cpp;jetfix/tests/decoding_tests.cpp;jetfix/tests/fix_encoding_stream_tests.cpp;jetfix/tests/fix_fragment_tests.cpp;jetfix/tests/jetfix_performance_tests.cpp;jetfix/tests/store_tests.cpp;main.cpp;md/platforms/mdp3_onixs/MDP3Listener.cpp;md/platforms/mdp3_onixs/MDP3Main.cpp;md/platforms/mdp3_onixs/MDP3Utils.cpp;md/platforms/mdp3_onixs/tests/mdp3_tests.cpp;md/run_md.cpp;order_man/IFIXGateway.cpp;order_man/IOrderObserver.cpp;order_man/OldOrderMan.cpp;order_man/OrderMan.cpp;order_man/OrderState.cpp;order_man/OrderStore.cpp;order_man/WorkingOrder.cpp;order_man/components/MDSource.cpp;order_man/components/SecuritySource.cpp;order_man/events/TimeChange.cpp;order_man/fix_order_codec.cpp;order_man/order_man_utils.cpp;persistence/IStore.cpp;persistence/PersistenceServiceServer.cpp;persistence/SqliteStore.cpp;persistence/tests/PersistenceServiceTests.cpp;risk_limits/IRiskLimitObserver.cpp;risk_limits/RiskLimitManager.cpp;risk_limits/RiskLimiter.cpp;risk_limits/SharedRiskLimiter.cpp;risk_limits/tests/RiskLimitsTests.cpp;setup/BootstrapActor.cpp;setup/CommandLine.proto;setup/ServiceHostActor.cpp;spreader/QuoteLegPriceQuantityState.cpp;spreader/SimpleSpreader.cpp;spreader/SingleLegQuoter.cpp;spreader/SpreaderBase.cpp;testing/catch_test_runner.cpp;user/UserServiceServer.cpp)
+6 -1
View File
@@ -5,6 +5,7 @@
#include "lib/config/protos/logging.pb.h"
#include "lib/config/protos/Executor.pb.h"
#include "lib/utils/init_spark_lib.h"
#include "server/sparkd/md/run_md.h"
#include "setup/BootstrapActor.h"
#include "fabric/Domain.h"
#include "testing/catch_test_runner.h"
@@ -14,7 +15,11 @@ int main( int argc, char*argv [] )
using namespace bts;
os::set_thread_name("main");
if (argc > 1 && std::string(argv[1]) == "test")
if (argc > 1 && std::string(argv[1]) == "record") {
run_recorder("./", "futures.coconut");
}
if (argc > 1 && std::string(argv[1]) == "test")
bts::run_tests(--argc, ++argv);
else {
utils::init_spark_lib();
+6
View File
@@ -1,6 +1,7 @@
#include "run_md.h"
#include "lib/md/relay/RelayRecorder.h"
#include "lib/md/PlatformLoader.h"
#include "lib/md/relay/RelayRecorder.h"
#include "lib/utils/bts_assert.h"
#include "lib/config/config.h"
#include "lib/config/protos/MarketData.pb.h"
@@ -56,3 +57,8 @@ void run_market_datapublishers() {
});
}
void run_recorder(const char* path, const char* filename) {
run_market_datapublishers();
record_everything(path, filename);
}
+3 -1
View File
@@ -1,3 +1,5 @@
#pragma once
void run_market_datapublishers();
void run_market_datapublishers();
void run_recorder(const char* path, const char* filename);
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<RemoteTarget>-1467508073;localhost (username=, port=2000, authentication=Password)</RemoteTarget>
</PropertyGroup>
</Project>