schema change and monitor process questions

99 views
Skip to first unread message

jiaweiq

unread,
Nov 14, 2019, 6:37:30 AM11/14/19
to AquaQ kdb+/TorQ
Hi, 

I have two questions after using TorQ,

1) if I need to change rdb/hdb schema? how could I could that? I saw kdb+ has dbmaint.q but wondering if something more automated has been implemented in TorQ
2) when I run torq in Mac setting, monitor process's HTML GUI works fine. But if I deploy it in a docker container, the GUI shows not status = connected. is there any firewall/internet setting needed?

Thanks
JQ 

nicolew02

unread,
Nov 14, 2019, 12:54:43 PM11/14/19
to AquaQ kdb+/TorQ
Hi JQ,To change the rdb/hdb schema, you can go into database.q file from the TorQ-Finance-Starter-Pack and update your schema there.
As an example, I'm adding an average price column to the end of the schema:

Within the database.q file
trade:([]time:`timestamp$(); sym:`g#`symbol$(); price:`float$(); size:`int$(); stop:`boolean$(); cond:`char$(); ex:`char$();avprice:`float$())
save and exit the file, then restart your stack and check your schema.When the processes subscribes to the tickerplant, they subscribe to the schema from the database.q file so this would probably be the easiest way to change schemas.
You will have to change the format of the data coming in from the feed.
If you're thinking of changing schemas intraday, you should remove or rename the TP log file after the change (otherwise there will be errors).If you're looking to apply the change to historical data on-disk, dbmaint.q is your best bet.
Your schema file will have to be changed to be consistent with the changes you make as well.Regarding your second question, you'll need to check that you can communicate into the container. Can you access the process from qpad/qstudio when it's in the container?Hope this helps
Nicole

jiaweiq

unread,
Nov 14, 2019, 9:43:03 PM11/14/19
to AquaQ kdb+/TorQ
Hi Nicole, 

Thanks for your reply. for the 2nd question, I can communicate to the q process inside the docker as I opened all ports. I was able to use web browser or qpython to do queries. probably was just the monitor HTML GUI not working, i.e. it shows not connected. I suspect the monitor process is working fine as I use browser to get into the service and run .hb.hb, it shows active heartbeats.

Not a big deal, just wondering if there is any easy fix.

JQ

jiaweiq

unread,
Nov 15, 2019, 2:16:43 AM11/15/19
to AquaQ kdb+/TorQ
I think I found the problem but don't know how to fix it.

in /html/index.html, there one line "KDBCONNECT.init(MYKDBSERVER, MYKDBPORT);

MYKDBSERVER was set to some non-ip id like "d6010b912e2b" if I run it from docker. it seems using the ipa function from html.q to get this. but I'm not sure what was the problem. It could be a linux package not installed or a network setting needed to be changed in docker. 

A not so clean work-around. I manually changed MYKDBSERVER to the hosting machine's IP address in index.html.

Thanks
JQ

nicolew02

unread,
Nov 15, 2019, 10:57:26 AM11/15/19
to AquaQ kdb+/TorQ
Hey JQ,

No problem at all!
Unfortunately at the minute we don't have a work-around for your other issue though. 

Kind regards,

Nicole
Reply all
Reply to author
Forward
0 new messages