Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions code/processes/segmentedtickerplant.q
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ tablelist:{.stpps.t}

// subscribers who want to replay need this info
subdetails:{[tabs;instruments]
`schemalist`logfilelist`rowcounts`date`logdir!(.ps.subscribe\:[tabs;instruments];.stplg.replaylog[tabs];tabs#.stplg `rowcount;(.eodtime `d);`$getenv`KDBTPLOG)
`schemalist`logfilelist`rowcounts`date`logdir!(.ps.subscribe\:[tabs;instruments];.stplg.replaylog[tabs];tabs#.stplg `rowcount;(.eodtime `d);.stplg.kdbtplog)
}

// Generate table and schema information and set up default table UPD functions
generateschemas:{
.stpps.init[tables[] except `currlog];
.stpps.init[tables[] except `currlog`heartbeat`logmsg`svrstoload];
.stpps.attrstrip[.stpps.t];

// Table UPD functions attach the current timestamp by default, if STP is chained these do nothing
Expand All @@ -59,8 +59,11 @@ setup:{[batch]
.stplg.updmsg:.stplg.upd[batch];
.stplg.ts:.stplg.zts[batch];
.u.upd:.stpps.upd[chainmode];
.dotz.set[`.z.ts;.stpps.zts[chainmode]];

.dotz.set[`.z.ts;
{[f;x] @[;x;()]each f}
(@[value;.dotz.getcommand[`.z.ts];{{}}];
.stpps.zts[chainmode])];

// Error mode - error trap UPD to write failed updates to separate TP log
if[.stplg.errmode;
.stp.upd:.u.upd;
Expand Down
2 changes: 1 addition & 1 deletion code/segmentedtickerplant/stplog.q
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ errorlogname:@[value;`.stplg.errorlogname;`segmentederrorlogfile]
// Create stp log directory
// Log structure `:stplogs/date/tabname_time
createdld:{[name;date]
if[not count dir:hsym `$getenv[`KDBTPLOG];.lg.e[`stp;"log directory not defined"];exit 1];
if[not count dir:hsym .stplg.kdbtplog;.lg.e[`stp;"log directory not defined"];exit 1];
.os.md dir;
.os.md .stplg.dldir:` sv dir,`$raze/[string name,"_",date];
};
Expand Down
1 change: 1 addition & 0 deletions config/settings/segmentedtickerplant.q
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ errmode:1b; // Enable error mode for STP
batchmode:`defaultbatch; // [memorybatch|defaultbatch|immediate]
replayperiod:`day // [period|day|prior]
customcsv:hsym first .proc.getconfigfile["stpcustom.csv"]; // Location for custom logging mode csv
kdbtplog:`$getenv`KDBTPLOG;

\d .proc
loadcommoncode:0b // do not load common code
Expand Down