kaq-quant-common 0.2.4__py3-none-any.whl → 0.2.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,12 +16,13 @@ class LimitOrderHelper:
16
16
  self,
17
17
  ddb: KaqQuantDdbStreamWriteRepository | KaqQuantDdbStreamMTWWriteRepository,
18
18
  ddb_table_name: str,
19
+ _flush_interval_ms:int = 100
19
20
  ):
20
21
  # 最新快照缓存与刷库线程控制
21
22
  self._latest_snapshots: dict[str, tuple] = {}
22
23
  self._latest_lock = threading.Lock()
23
24
  # 写入到ddb的频率,默认100ms
24
- self._flush_interval_ms = 100
25
+ self._flush_interval_ms = _flush_interval_ms
25
26
  self._stop_event = threading.Event()
26
27
  self._flusher_thread = threading.Thread(target=self._flush_loop, daemon=True)
27
28
  self._flusher_thread.name = "LimitOrderHelperFlusherThread"
@@ -22,7 +22,7 @@ class KaqQuantDdbPoolStreamReadRepository:
22
22
 
23
23
  # 连接地址为localhost,端口为8848的DolphinDB,登录用户名为admin,密码为123456的账户,连接数为8
24
24
  self.pool = ddb.DBConnectionPool(host, port, pool_size, user, passwd,
25
- loadBalance=True,
25
+ loadBalance=False,
26
26
  compress=True,
27
27
  protocol=protocal,
28
28
  reConnect=True,
@@ -26,10 +26,10 @@ class KaqQuantDdbStreamWriteRepository:
26
26
  try:
27
27
  mutex.acquire()
28
28
  self.session = ddb.session(enableASYNC=True)
29
- self.session.connect(host, port, user, passwd, tryReconnectNums=10, reconnect=True, keepAliveTime=1000, readTimeout=10, writeTimeout=5)
29
+ self.session.connect(host, port, user, passwd, tryReconnectNums=100, reconnect=True, keepAliveTime=1000, readTimeout=10, writeTimeout=5)
30
30
  # 流表订阅用的
31
31
  # self.session.enableStreaming(threadCount=5)
32
- # self.pool = ddb.DBConnectionPool(host, port, userid=user, password=passwd, loadBalance=True, reConnect=True, tryReconnectNums=5, sqlStd=SqlStd.MySQL)
32
+ # self.pool = ddb.DBConnectionPool(host, port, userid=user, password=passwd, loadBalance=False, reConnect=True, tryReconnectNums=5, sqlStd=SqlStd.MySQL)
33
33
 
34
34
  # 需要注意的是 fetchSize 取值不能小于 8192 (记录条数)
35
35
  self.size = 8192
@@ -208,7 +208,7 @@ class KaqQuantDdbStreamWriteSyncRepository:
208
208
  try:
209
209
  mutex.acquire()
210
210
  self.session = ddb.session()
211
- self.session.connect(host, port, user, passwd, tryReconnectNums=10, reconnect=True, keepAliveTime=1000, readTimeout=10, writeTimeout=5)
211
+ self.session.connect(host, port, user, passwd, tryReconnectNums=100, reconnect=True, keepAliveTime=1000, readTimeout=10, writeTimeout=5)
212
212
 
213
213
  self.batch_writer = DDBAsyncDFWriter(ddb.TableAppender(table_name=self.tableName, conn=self.session), batch_size=batch_size, flush_interval_ms=flush_interval_ms)
214
214
  # 需要注意的是 fetchSize 取值不能小于 8192 (记录条数)
@@ -240,7 +240,7 @@ class KaqQuantDdbStreamMTWWriteRepository:
240
240
  try:
241
241
  mutex.acquire()
242
242
  self.session = ddb.session(enableASYNC=True)
243
- self.session.connect(host, port, user, passwd, tryReconnectNums=10, reconnect=True, keepAliveTime=1000, readTimeout=10, writeTimeout=5)
243
+ self.session.connect(host, port, user, passwd, tryReconnectNums=100, reconnect=True, keepAliveTime=1000, readTimeout=10, writeTimeout=5)
244
244
  self.batch_writer = ddb.MultithreadedTableWriter(
245
245
  host, port, user, passwd, tableName=tableName, dbPath='',
246
246
  batchSize=batch_size, throttle=throttle, threadCount=threadCount, partitionCol=partitionCol
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kaq_quant_common
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary:
5
5
  Author: kevinfuture
6
6
  Author-email: liuenbofuture@foxmail.com
@@ -28,7 +28,7 @@ kaq_quant_common/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
28
28
  kaq_quant_common/common/ddb_table_monitor.py,sha256=7Yihz_uGGujo_QqqPl45Gp8fwUMMw1auXx5egbzyYlE,3662
29
29
  kaq_quant_common/common/http_monitor.py,sha256=_yChiwfVv1c5g_lKgYUjWY40fX61BWVK8SL4kXwRfwk,2375
30
30
  kaq_quant_common/common/modules/funding_rate_helper.py,sha256=BVGNS6E7aVPITOz5u4g7vBUHOrm1S1Uri8psgWxp-BQ,3853
31
- kaq_quant_common/common/modules/limit_order_helper.py,sha256=Py9DPBXq1-QnjEh6mGQOA7vD3TVNUabnS_rMf0SQx5U,3853
31
+ kaq_quant_common/common/modules/limit_order_helper.py,sha256=2k54QO-WwUmFHKvThGcdDk79Xfs7_uJt9F5h2py7zMg,3905
32
32
  kaq_quant_common/common/modules/limit_order_symbol_monitor.py,sha256=TBK48qyeCSQvkfDMv3J_0UM7f3OuBRKRFYDcL9kG6Cs,2876
33
33
  kaq_quant_common/common/modules/limit_order_symbol_monitor_group.py,sha256=oEqHIwxhqAzckmluHJHZHiHUNmAyaS2JyK2nXO58UhY,2394
34
34
  kaq_quant_common/common/monitor_base.py,sha256=E4EUMsO3adNltCDNRgxkvUSbTTfKOL9S1zzN3WkZvpU,2467
@@ -39,10 +39,10 @@ kaq_quant_common/common/statistics/kline_history_statistics.py,sha256=pQgWkP7Z0n
39
39
  kaq_quant_common/common/ws_wrapper.py,sha256=JNJ0CIjDXgCsRjOLSbCi7ysYDHw7tT_aK7V4ADqw3vA,452
40
40
  kaq_quant_common/config/config.yaml,sha256=ST_QBLo7kwVaoNOvuN3mpeSF7LPNSWdD7EjxrBYZYBs,230
41
41
  kaq_quant_common/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
- kaq_quant_common/resources/kaq_ddb_pool_stream_read_resources.py,sha256=Y-rtGpBF3bNh2mPZ2Lze6D9JZnpkqh24OEh7okikh1w,2536
42
+ kaq_quant_common/resources/kaq_ddb_pool_stream_read_resources.py,sha256=q4P96rSrEcWn9ki09UD0vw00iFq_bpgOFTrRzVG7uCA,2537
43
43
  kaq_quant_common/resources/kaq_ddb_stream_init_resources.py,sha256=0MxxbajocTFzcRD344rfZQPKOwwuqCbyoT6dQpIox-o,3349
44
44
  kaq_quant_common/resources/kaq_ddb_stream_read_resources.py,sha256=WShsXMoL8o-JZvrtAd7H2Cg-vrE47QbsdGgURaQwiZs,3165
45
- kaq_quant_common/resources/kaq_ddb_stream_write_resources.py,sha256=_-bNnxnG5I98JOlV46FYXlYoJRkzlMzWREHUonornF4,12638
45
+ kaq_quant_common/resources/kaq_ddb_stream_write_resources.py,sha256=HaRWik7aJydoxGnfMn6-E6XAevJBv-PJgG1C-TobAeU,12642
46
46
  kaq_quant_common/resources/kaq_mysql_init_resources.py,sha256=UcqWey6LgoMqvLq1SxK33nS6-rkViGYhzUPxcrucOks,827
47
47
  kaq_quant_common/resources/kaq_mysql_resources.py,sha256=282jpXvYlEQNx-hicYTNBHDii85KYgN7BQQSMS9aPFM,13211
48
48
  kaq_quant_common/resources/kaq_postgresql_resources.py,sha256=iG1eYkciI0xUIBdEpGqKGOLBFxvVrfbBoTuaOmhQ0v0,1762
@@ -62,6 +62,6 @@ kaq_quant_common/utils/signal_utils.py,sha256=zBSyEltNTKqkQCsrETd47kEBb3Q_OWUBUn
62
62
  kaq_quant_common/utils/sqlite_utils.py,sha256=UDDFKfwL0N-jFifl40HdyOCENh2YQfW5so6hRaSJpv0,5722
63
63
  kaq_quant_common/utils/uuid_utils.py,sha256=pm_pnXpd8n9CI66x3A20cOEUiriJyqHaKGCeLrgkBxU,71
64
64
  kaq_quant_common/utils/yml_utils.py,sha256=gcKjb_-uuUajBGAl5QBPIZTg2wXm7qeeJvtHflj_zOE,4513
65
- kaq_quant_common-0.2.4.dist-info/METADATA,sha256=J-fMkZRZdJJSSOkTumujjx2t9HhwgxgKtLKtvNqwaTk,1970
66
- kaq_quant_common-0.2.4.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
67
- kaq_quant_common-0.2.4.dist-info/RECORD,,
65
+ kaq_quant_common-0.2.6.dist-info/METADATA,sha256=iie2yF9hawVHnby2gji5uT33bCORlgYdGxfYXSkQxw8,1970
66
+ kaq_quant_common-0.2.6.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
67
+ kaq_quant_common-0.2.6.dist-info/RECORD,,