Compare commits
30
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a2ca8045e | ||
|
|
be6a252039 | ||
|
|
2456c1a3a4 | ||
|
|
84e61123a1 | ||
|
|
f9f2379d3e | ||
|
|
02f6f3475c | ||
|
|
775dba6377 | ||
|
|
adb190a0e0 | ||
|
|
b1c7d1300d | ||
|
|
ee925a12f9 | ||
|
|
621a4b2ca7 | ||
|
|
250a258935 | ||
|
|
95d97a69da | ||
|
|
dfce23a33d | ||
|
|
709334a1aa | ||
|
|
f9a6e0963c | ||
|
|
b2879837c6 | ||
|
|
0d03ddb009 | ||
|
|
1fb42ade59 | ||
|
|
129650e9d4 | ||
|
|
7e04f02327 | ||
|
|
abda2dbf97 | ||
|
|
ad1a45cf49 | ||
|
|
09e2a1764f | ||
|
|
a780668bce | ||
|
|
5b79aeaa14 | ||
|
|
049c006b5f | ||
|
|
6fdc344472 | ||
|
|
cb09b93553 | ||
|
|
21447d32e5 |
No files matched your search
@@ -0,0 +1,61 @@
|
||||
pipeline {
|
||||
agent {
|
||||
label 'os=windows && ram=8gb && installed=vs2022 && installed=python3'
|
||||
}
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
echo 'Building..'
|
||||
script {
|
||||
if (fileExists('.venv')) {
|
||||
echo 'Using existing Python virtual env'
|
||||
} else {
|
||||
echo 'Creating Python virtual env'
|
||||
bat 'tools\\ensure_venv.cmd'
|
||||
}
|
||||
}
|
||||
bat """
|
||||
call .venv\\Scripts\\activate
|
||||
call pip install -r requirements.txt
|
||||
call python tools\\py\\build_spark.py --configuration Release
|
||||
"""
|
||||
}
|
||||
post {
|
||||
always {
|
||||
echo '========Build Done========'
|
||||
}
|
||||
success {
|
||||
echo '========Build executed successfully========'
|
||||
}
|
||||
failure {
|
||||
echo '========Build execution failed========'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Installing') {
|
||||
steps {
|
||||
echo 'Installing...'
|
||||
bat """
|
||||
"C:\\Program Files\\7-Zip\7z.exe" a -tzip Release.zip "build\\Release"
|
||||
"""
|
||||
}
|
||||
}
|
||||
stage('Archiving') {
|
||||
steps {
|
||||
echo 'Archiving...'
|
||||
archiveArtifacts artifacts: 'Release.zip', followSymlinks: false, onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
echo '========Pipeline Done========'
|
||||
}
|
||||
success {
|
||||
echo '========Pipeline executed successfully ========'
|
||||
}
|
||||
failure {
|
||||
echo '========Pipeline execution failed========'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
pipeline {
|
||||
agent {
|
||||
label 'lab-main'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
echo 'Building..'
|
||||
if (!fileExists('.venv')) {
|
||||
echo 'Creating python virtual env'
|
||||
sh 'python3 -m venv .venv'
|
||||
}
|
||||
sh """
|
||||
. .venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
python tools/py/build_sparkd.py --compiler gcc --configuration release
|
||||
"""
|
||||
}
|
||||
}
|
||||
stage('Installing') {
|
||||
steps {
|
||||
echo 'Installing..'
|
||||
sh """
|
||||
cd build/gcc/release
|
||||
cmake --build . --target install
|
||||
"""
|
||||
sh 'tar -czf install.tar.gz install'
|
||||
}
|
||||
}
|
||||
stage('Archiving') {
|
||||
steps {
|
||||
echo 'Archiving..'
|
||||
archiveArtifacts artifacts: 'install.tar.gz', followSymlinks: false, onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,8 +55,10 @@
|
||||
private void _on_vss(bts.api.core.Update<VolSurfaceEntryImmutable, UInt64> update) {
|
||||
IEnumerable<VolSurfaceEntryImmutable> all_vss = update.all;
|
||||
var this_vs_vss = all_vss.Where(vs => vs.VsId == _volsurface_id);
|
||||
bts.Log.Gen.info(String.Format("SingleVolSurfaceGateway._on_vss count:{0} vs_count:{1}",
|
||||
all_vss.Count(), this_vs_vss.Count()));
|
||||
bts.Log.Gen.info(
|
||||
$"SingleVolSurfaceGateway._on_vss vs_count: {this_vs_vss.Count()} " +
|
||||
$"all: {update.all.Count()} added: {update.added.Count()} " +
|
||||
$"updated: {update.changed.Count()} removed: {update.removed.Count()}");
|
||||
if (this_vs_vss.Count() == 0) {
|
||||
return;
|
||||
}
|
||||
@@ -110,8 +112,13 @@
|
||||
"SingleVolSurfaceGateway._on_bb_data Time to commit volsurface {0} {1} msecs",
|
||||
_volsurface_id, _timer.lastIntervalTime));
|
||||
var archived_theos = _get_theos();
|
||||
if (archived_theos != null)
|
||||
if (archived_theos != null) {
|
||||
_timer.start();
|
||||
_analytics_service.archive_theos(archived_theos);
|
||||
_timer.stop();
|
||||
Log.Gen.info($"SingleVolSurfaceGateway._on_bb_data archiving theos size: " +
|
||||
$"{archived_theos.SecTheo.Count} time: {_timer.lastIntervalTime} msecs");
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.Gen.warn(ex.ToString());
|
||||
_bb.post(SparkTags.MessageDisplayTag,
|
||||
|
||||
@@ -270,6 +270,7 @@ namespace mbts.spark {
|
||||
new mbts.analytics.VolSurfaceNonVolInput(exp_param_map.exp_map.ToDictionary()));
|
||||
} else if (_in_bb_req_vol.Equals(tag)) {
|
||||
ClientArchivedVolRequest client_req = _bb.read_state(_in_bb_req_vol);
|
||||
bts.Log.Ui.info($"VolSurfaceBusManager._on_bb_update ClientArchivedVolRequest: {client_req.ToString()}");
|
||||
ArchivedTheoRetrieval ret = client_req.ret;
|
||||
if (ret == null || ret.SecTup == null) {
|
||||
bts.Log.Ui.warn($"VolSurfaceBusManager malformed ArchivedTheoRetrieval");
|
||||
|
||||
@@ -5,6 +5,7 @@ using bts.api;
|
||||
using bts.collections;
|
||||
using System.Linq;
|
||||
using bts.api.orderman;
|
||||
using bts.api.analytics;
|
||||
using bts;
|
||||
|
||||
namespace mbts.spark {
|
||||
@@ -23,6 +24,8 @@ namespace mbts.spark {
|
||||
_order_service = order_service;
|
||||
_bb.subscribe(SparkTags.AllInterpGreeks);
|
||||
_bb.subscribe(SparkTags.SystemContractsTag);
|
||||
_bb.subscribe(SparkTags.CurrentUser);
|
||||
_bb.subscribe(SparkTags.VolSurfaceUsageTag);
|
||||
_bb.data_callback += _on_data;
|
||||
}
|
||||
|
||||
@@ -55,10 +58,32 @@ namespace mbts.spark {
|
||||
return rv;
|
||||
}
|
||||
|
||||
private IReadOnlyDictionary<string, OptionTheoInterpolationData>
|
||||
_filter_for_publish(IReadOnlyDictionary<string, OptionTheoInterpolationData> all_theos) {
|
||||
HashSet<string> syms = new HashSet<string>();
|
||||
VolSurfaceUsageListImmutable usage = _bb.read_state(SparkTags.VolSurfaceUsageTag);
|
||||
string current_user = _bb.read_state(SparkTags.CurrentUser).name;
|
||||
foreach (var u in usage.UsageList) {
|
||||
VolSurfaceInput vs_input =
|
||||
_bb.read_state(SparkTags.VolSurfaceCommittedInputTag(u.VsId));
|
||||
if (vs_input != null) {
|
||||
if (vs_input.surface_settings.core_settings.vs_manager ==
|
||||
current_user) {
|
||||
syms.Add(u.SymbolName);
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
all_theos.Where(kv => syms.Contains(kv.Key)).ToDictionary(kv => kv.Key, kv => kv.Value);
|
||||
}
|
||||
|
||||
private void _publish_data() {
|
||||
SystemContractData sc_data = _bb.read_state(SparkTags.SystemContractsTag, null);
|
||||
IReadOnlyDictionary<string, OptionTheoInterpolationData> all_theos =
|
||||
_bb.read_state(SparkTags.AllInterpGreeks, null);
|
||||
all_theos = _filter_for_publish(all_theos);
|
||||
// find the symbol vs vs_id, get the committed vs, see if it is
|
||||
// owned by the current user, and only then publish it
|
||||
IReadOnlyDictionary<string, OptionDriverPriceMap> all_drivers =
|
||||
_bb.read_state(SparkTags.AllOptionDriverBBOTag, null);
|
||||
if (sc_data == null || all_theos == null || all_drivers == null)
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <set>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace bts {
|
||||
namespace api {
|
||||
@@ -55,8 +56,14 @@ class StatefulPublisher {
|
||||
}
|
||||
}
|
||||
void erase(TKey m) {
|
||||
// there is an assumption that we are not dealing with that within a
|
||||
// transaction, add_or_update and erase is called just once a key
|
||||
if (_has_key(m)) {
|
||||
_erased.insert(m);
|
||||
if (_keep_state)
|
||||
_state_data.erase(m);
|
||||
else
|
||||
_state.erase(m);
|
||||
}
|
||||
}
|
||||
void flush() {
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "lib/persistence/SqliteStore.h"
|
||||
#include "lib/utils/PBUtils.h"
|
||||
#include "lib/utils/Puid.h"
|
||||
#include "lib/utils/TimeStamp.h"
|
||||
#include "lib/utils/bts_assert.h"
|
||||
#include "server/sparkd/algo/AlgoDefinitionServiceServer.h"
|
||||
#include <boost/algorithm/string.hpp>
|
||||
@@ -90,6 +91,14 @@ struct AnalyticsServiceServer::PImpl {
|
||||
const std::string vs_usage_ns = "volsurface_usage";
|
||||
const std::string reports_ns = "reports";
|
||||
const std::string archived_theos_ns = "archived_theos";
|
||||
// this is the total number of vs data that will be stored in the db,
|
||||
// beyond that, old values will be recycled
|
||||
const size_t vs_history_sz = 500;
|
||||
// anologous to above for archived theos (however unlike the above this is
|
||||
// recycled periodically, and is not published out)
|
||||
const size_t archived_theos_history_sz = 5000;
|
||||
const size_t n_theos_archives_before_cleanup = 100;
|
||||
size_t n_theos_archives = 0;
|
||||
std::unique_ptr<persistence::IStore> vs_store;
|
||||
std::unique_ptr<persistence::IStore> exp_params_store;
|
||||
std::unique_ptr<persistence::IStore> vs_usage_store;
|
||||
@@ -126,24 +135,36 @@ AnalyticsServiceServer::AnalyticsServiceServer(
|
||||
: AnalyticsServiceBase(context),
|
||||
me(new PImpl(
|
||||
context,
|
||||
make_volsurfaces_stateful_publisher(),
|
||||
bts::api::StatefulPublisher<VolSurfaceEntry, uint64_t>(
|
||||
make_volsurfaces_publisher(),
|
||||
[](const VolSurfaceEntry &v) { return v.save_time(); },
|
||||
true),
|
||||
// make_volsurfaces_stateful_publisher(),
|
||||
make_exp_parameters_stateful_publisher(),
|
||||
make_volsurface_usage_stateful_publisher(),
|
||||
make_reports_stateful_publisher())) {
|
||||
// publishing all vol surfaces
|
||||
LOG(Gen, Info, "Starting AnalyticsServiceServer");
|
||||
_clean_up_vss();
|
||||
_clean_up_archived_theos();
|
||||
auto vs_table = me->vs_store->retrieve_all();
|
||||
for (auto const &ns_vals : vs_table) {
|
||||
const std::string &vs_name = ns_vals.first;
|
||||
const std::map<std::string, std::string> &key_vals = ns_vals.second;
|
||||
LOG(OrderMan, Info, "vs:{} entries:{}", vs_name, key_vals.size());
|
||||
LOG(OrderMan, Info, "vs: {} entries: {}", vs_name, key_vals.size());
|
||||
for (const auto &kvp : key_vals) {
|
||||
const std::string &key = kvp.first;
|
||||
const std::string &val = kvp.second;
|
||||
LOG(OrderMan, Diag, "vs:{} key:{} val:{}", vs_name, key, val);
|
||||
LOG(OrderMan, Info,
|
||||
"AnalyticsServiceServer::cons loaded from db vs: {} key: {}",
|
||||
vs_name, key);
|
||||
VolSurfaceEntry vs_entry;
|
||||
utils::pb::from_string(val, &vs_entry);
|
||||
LOG(Gen, Diag,
|
||||
"AnalyticsServiceServer::cons loading to vs_publisher ns: {} "
|
||||
"key: {} vs_name: {} vs_id: {} vs.save_time: {}",
|
||||
vs_name, key, vs_entry.vs_name(), vs_entry.vs_id(),
|
||||
vs_entry.save_time());
|
||||
me->vs_publisher.add_or_update(vs_entry);
|
||||
}
|
||||
}
|
||||
@@ -213,6 +234,36 @@ void AnalyticsServiceServer::get_new_volsurface_id(
|
||||
void AnalyticsServiceServer::save_volsurface(
|
||||
const bts::api::analytics::VolSurfaceEntry &vs_entry_arg,
|
||||
const api::Response<::bts::api::ResultMessage> &response) {
|
||||
auto t0 = utils::TimeStamp::now().to_uint64();
|
||||
auto remove_oldest = [&](const std::string &vs_ns) {
|
||||
// return;
|
||||
int vs_id = vs_entry_arg.vs_id();
|
||||
// find all the keys belonging to this vs
|
||||
std::vector<uint64_t> vs_keys = {};
|
||||
for (const auto &kv : me->vs_publisher.state_data()) {
|
||||
if (kv.second.vs_id() == vs_id) {
|
||||
vs_keys.push_back(kv.first);
|
||||
}
|
||||
}
|
||||
LOG(Gen, Info,
|
||||
"AnalyticsServiceServer::save_volsurface vs_id: {} n_entries: {}",
|
||||
vs_entry_arg.vs_id(), vs_keys.size());
|
||||
if (vs_keys.size() <= me->vs_history_sz)
|
||||
return;
|
||||
// since we are already truncating it at the the start, we'll just
|
||||
// find the earliest key and delete it
|
||||
uint64_t key_to_delete = std::numeric_limits<uint64_t>::max();
|
||||
for (uint64_t k : vs_keys) {
|
||||
if (k < key_to_delete) {
|
||||
key_to_delete = k;
|
||||
}
|
||||
}
|
||||
LOG(Gen, Info,
|
||||
"AnalyticsServiceServer::save_volsurface removing row ns: {} key: {}",
|
||||
vs_ns, key_to_delete);
|
||||
me->vs_store->remove(vs_ns, {std::to_string(key_to_delete)});
|
||||
me->vs_publisher.erase(key_to_delete);
|
||||
};
|
||||
uint64_t ms_u = get_epoch();
|
||||
VolSurfaceEntry vs_entry = vs_entry_arg;
|
||||
vs_entry.set_save_time(ms_u);
|
||||
@@ -226,9 +277,15 @@ void AnalyticsServiceServer::save_volsurface(
|
||||
std::string value = utils::pb::to_string(vs_entry);
|
||||
me->vs_store->insert(ns, key, value);
|
||||
me->vs_publisher.add_or_update(vs_entry);
|
||||
remove_oldest(ns);
|
||||
me->vs_publisher.flush();
|
||||
api::ResultMessage ret;
|
||||
ret.set_success(true);
|
||||
auto t1 = utils::TimeStamp::now().to_uint64();
|
||||
LOG(Gen, Info,
|
||||
"AnalyticsServiceServer::save_volsurface ns: {} key: {} n_entries: {} "
|
||||
"time: {} ns",
|
||||
ns, key, me->vs_publisher.state_data().size(), t1 - t0);
|
||||
response(ret);
|
||||
}
|
||||
|
||||
@@ -370,9 +427,8 @@ void AnalyticsServiceServer::delete_report(
|
||||
void AnalyticsServiceServer::archive_theos(
|
||||
const bts::api::analytics::ArchivedTheoList &theo_list,
|
||||
const api::Response<::bts::api::ResultMessage> &resp) {
|
||||
LOG(Gen, Info,
|
||||
"AnalyticsServiceServer::archive_theos sec_tups: {} sec_theo: {}",
|
||||
theo_list.sec_tups().size(), theo_list.sec_theo().size());
|
||||
me->n_theos_archives++;
|
||||
uint64_t t0 = utils::TimeStamp::now().to_uint64();
|
||||
if (theo_list.sec_theo().empty()) {
|
||||
std::string err_msg = "Empty archived theo list, call failed";
|
||||
LOG(Gen, Error, "AnalyticsServiceServer::archive_theos {}", err_msg);
|
||||
@@ -383,12 +439,23 @@ void AnalyticsServiceServer::archive_theos(
|
||||
const std::string key = std::to_string(theo_list.save_time());
|
||||
std::string value = utils::pb::to_string(theo_list);
|
||||
me->theos_store->insert(ns, key, value);
|
||||
uint64_t t1 = utils::TimeStamp::now().to_uint64();
|
||||
uint64_t t_diff = t1 - t0;
|
||||
LOG(Gen, Info,
|
||||
"AnalyticsServiceServer::archive_theos sec_tups: {} sec_theo: {} time: "
|
||||
"{} ns",
|
||||
theo_list.sec_tups().size(), theo_list.sec_theo().size(), t_diff);
|
||||
if (me->n_theos_archives >= me->n_theos_archives_before_cleanup) {
|
||||
me->n_theos_archives = 0;
|
||||
_clean_up_archived_theos();
|
||||
}
|
||||
fire_cb(resp, true);
|
||||
}
|
||||
|
||||
void AnalyticsServiceServer::get_archived_theos(
|
||||
const bts::api::analytics::ArchivedTheoRetrieval &ret,
|
||||
const bts::api::Response<bts::api::analytics::ArchivedTheoList> &resp) {
|
||||
uint64_t t0 = utils::TimeStamp::now().to_uint64();
|
||||
LOG(Gen, Info, "AnalyticsServiceServer::get_archived_theos ret: {}",
|
||||
utils::pb::to_string(ret));
|
||||
auto contains_st = [&](const ArchivedTheoList &tl) {
|
||||
@@ -422,54 +489,80 @@ void AnalyticsServiceServer::get_archived_theos(
|
||||
}
|
||||
}
|
||||
}
|
||||
LOG(Gen, Info, "AnalyticsServiceServer::get_archived_theos ret: {} key: {}",
|
||||
utils::pb::to_string(ret), key);
|
||||
uint64_t t1 = utils::TimeStamp::now().to_uint64();
|
||||
uint64_t t_diff = t1 - t0;
|
||||
LOG(Gen, Info,
|
||||
"AnalyticsServiceServer::get_archived_theos ret: {} key: {} time: {} ns",
|
||||
utils::pb::to_string(ret), key, t_diff);
|
||||
resp(rv);
|
||||
}
|
||||
|
||||
AnalyticsServiceServer::~AnalyticsServiceServer() {}
|
||||
|
||||
// for a map where the key is the epoch timestamp, this returns the keys
|
||||
// to delete such that final size is final_sz
|
||||
std::set<std::string> get_keys_to_delete(
|
||||
const std::map<std::string, std::string> &time_keyed_map, size_t final_sz) {
|
||||
if (time_keyed_map.size() <= final_sz) {
|
||||
return {};
|
||||
}
|
||||
std::vector<uint64_t> keys_uint;
|
||||
for (const auto &kv : time_keyed_map) {
|
||||
try {
|
||||
keys_uint.push_back(std::stoull(kv.first));
|
||||
} catch (int) {
|
||||
LOG(Gen, Error,
|
||||
"AnalyticsServiceServer::get_keys_to_delete could not "
|
||||
"convert "
|
||||
"key: {} to uint",
|
||||
kv.first);
|
||||
}
|
||||
}
|
||||
// this is sorted lowest to highest
|
||||
std::sort(keys_uint.begin(), keys_uint.end());
|
||||
size_t n_del_rows = keys_uint.size() - final_sz;
|
||||
std::vector<uint64_t> keys_uint_to_del =
|
||||
std::vector<uint64_t>(keys_uint.begin(), keys_uint.begin() + n_del_rows);
|
||||
std::set<std::string> keys_to_del;
|
||||
for (auto k : keys_uint_to_del) {
|
||||
keys_to_del.insert(std::to_string(k));
|
||||
}
|
||||
return keys_to_del;
|
||||
}
|
||||
|
||||
void AnalyticsServiceServer::_clean_up_vss() {
|
||||
const size_t final_sz = 500;
|
||||
const size_t final_sz = me->vs_history_sz;
|
||||
auto all_rows = me->vs_store->retrieve_all();
|
||||
for (const auto &ns_k : all_rows) {
|
||||
auto t0 = utils::TimeStamp::now().to_uint64();
|
||||
const auto &vs = ns_k.first;
|
||||
const auto &vs_row_map = ns_k.second;
|
||||
if (vs_row_map.size() <= final_sz) {
|
||||
LOG(Gen, Info,
|
||||
"AnalyticsServiceServer::_clean_up_vss ignoring vs: {} because it "
|
||||
"has only {} rows",
|
||||
vs, vs_row_map.size());
|
||||
continue;
|
||||
}
|
||||
std::vector<uint64_t> keys_uint;
|
||||
for (const auto &r : vs_row_map) {
|
||||
const auto &k = r.first;
|
||||
try {
|
||||
keys_uint.push_back(std::stoull(k));
|
||||
} catch (int) {
|
||||
LOG(Gen, Error,
|
||||
"AnalyticsServiceServer::_clean_up_vss could not convert "
|
||||
"key: "
|
||||
"{} to uint",
|
||||
k);
|
||||
}
|
||||
}
|
||||
// sort and remove
|
||||
std::sort(keys_uint.begin(), keys_uint.end());
|
||||
size_t n_del_rows = keys_uint.size() - final_sz;
|
||||
std::vector<uint64_t> keys_uint_to_del = std::vector<uint64_t>(
|
||||
keys_uint.begin(), keys_uint.begin() + n_del_rows);
|
||||
std::set<std::string> keys_to_del;
|
||||
for (auto k : keys_uint_to_del) {
|
||||
keys_to_del.insert(std::to_string(k));
|
||||
}
|
||||
LOG(Gen, Info,
|
||||
"AnalyticsServiceServer::_clean_up_vss vs: {} n_rows: {} removing {} "
|
||||
"rows",
|
||||
vs, keys_uint.size(), keys_to_del.size());
|
||||
auto keys_to_del = get_keys_to_delete(vs_row_map, final_sz);
|
||||
me->vs_store->remove(vs, keys_to_del);
|
||||
auto t1 = utils::TimeStamp::now().to_uint64();
|
||||
LOG(Gen, Info,
|
||||
"AnalyticsServiceServer::_clean_up_vss vs: {} n_rows: {} "
|
||||
"n_dels {} time: {} ns",
|
||||
vs, vs_row_map.size(), keys_to_del.size(), t1 - t0);
|
||||
}
|
||||
}
|
||||
|
||||
void AnalyticsServiceServer::_clean_up_archived_theos() {
|
||||
uint64_t t0 = utils::TimeStamp::now().to_uint64();
|
||||
std::map<std::string, std::map<std::string, std::string>> all_data =
|
||||
me->theos_store->retrieve_all();
|
||||
auto it = all_data.find(me->archived_theos_ns);
|
||||
if (it == all_data.end())
|
||||
return;
|
||||
const std::map<std::string, std::string> &theo_data = it->second;
|
||||
std::set<std::string> keys_to_del =
|
||||
get_keys_to_delete(theo_data, me->archived_theos_history_sz);
|
||||
me->theos_store->remove(me->archived_theos_ns, keys_to_del);
|
||||
uint64_t t1 = utils::TimeStamp::now().to_uint64();
|
||||
uint64_t t_diff = t1 - t0;
|
||||
LOG(Gen, Info,
|
||||
"AnalyticsServiceServer::_clean_up_archived_theos n_dels: {} "
|
||||
"time: {} ns",
|
||||
keys_to_del.size(), t_diff);
|
||||
}
|
||||
} // namespace bts::analytics
|
||||
@@ -72,5 +72,6 @@ class AnalyticsServiceServer
|
||||
|
||||
private:
|
||||
void _clean_up_vss();
|
||||
void _clean_up_archived_theos();
|
||||
};
|
||||
} // namespace bts::analytics
|
||||
@@ -115,6 +115,7 @@ void Run::run(
|
||||
auto impl = [&mbo_writer, &tss_dispatcher, &type, &cleanup]() {
|
||||
LOG(md, Info, "Run::impl lambda t_id:{} t_name", os::get_thread_id(),
|
||||
get_thread_name());
|
||||
return;
|
||||
if (cleanup)
|
||||
md::cmds::Cleanup::execute();
|
||||
if (type == Run::MDType::Configured) {
|
||||
@@ -148,6 +149,7 @@ void Run::run(
|
||||
threading::make_thread("Emumba", []() { run_emumba(); }).detach();
|
||||
}
|
||||
if (bts::config::get<bts::md::MarketDataConfig>().use_sim()) {
|
||||
return;
|
||||
threading::make_thread("ExchangeSimGLBX", [&mbo_writer]() {
|
||||
sim::start_exchange_sim(api::Venue::VENUE_SIM, mbo_writer);
|
||||
}).detach();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@echo off
|
||||
@echo on
|
||||
|
||||
@call %~dp0..\tools\ensure_venv.cmd
|
||||
touch %~dp0..\src\lib\CMakeLists.txt
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
@echo off
|
||||
|
||||
call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools\\VsDevCmd.bat"
|
||||
call .venv\\Scripts\\activate
|
||||
call set PYTHONPATH=%~dp0\..\.venv\Scripts\python
|
||||
call .venv\Scripts\python.exe tools\py\build_spark.py %*
|
||||
|
||||
EXIT /B %ERRORLEVEL%
|
||||
@@ -173,8 +173,7 @@ def _get_arg_parser():
|
||||
metavar='debug|release',
|
||||
type=str,
|
||||
nargs='?',
|
||||
help='The build configuration',
|
||||
default='Debug')
|
||||
help='The build configuration')
|
||||
|
||||
parser.add_argument(
|
||||
'-o',
|
||||
@@ -336,9 +335,10 @@ def _main():
|
||||
link_build_dir = arg_to_path(get_arg(args_dict, 'link_output_dir'))
|
||||
targets = flatten_arglist(get_arg(args_dict, 'target'))
|
||||
verbosity = get_arg(args_dict, 'verbosity') or None
|
||||
|
||||
configuration = args.configuration or 'Release' if targets is not None and any(
|
||||
filter(lambda t: t.lower() == 'publish', targets)) else 'Debug'
|
||||
build(
|
||||
configuration=args.configuration,
|
||||
configuration=configuration,
|
||||
clean=args.clean,
|
||||
restore=args.restore,
|
||||
build_dir=build_dir,
|
||||
|
||||
Reference in new issue
Block a user